Unsafe code in submodules


#1

How I can disallow unsafe keywords in submodules?


#2

https://play.rust-lang.org/?gist=2fd117d57fceec72bf5c4dc97347d59f&version=stable&mode=debug&edition=2015


#3

I need a deny placed outside the submodule, and that this deny can not be overridden inside the module in any way. Is it possible?


#4

it should work like this.

In your code, import your submodule like this:

#[forbid(unsafe_code)]
mod foo;

#5

Thank you very much)
I work on my own super safe kernel, and this feature very needed


#6

One more question. Is it possible to prohibit the use of “extern crate” in the submodule?