https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=b137113f78a25cec34a258505cf41e3f
I'd like the ability to forbid the use of unsafe_code over all dependencies with at least a per-crate whitelist. For a quick PoC I've wrapped rustc to add --cap-lints=forbid before cargo's arguments and use RUSTFLAGS=-Funsafe-code to forbid unsafe code. No per-crate (or better) whitelist there.
While trying to write some async code I noticed that await!() wasn't in core #56767, so I checked the sources to find it is in std but uses this scary attribute.
I agree #[allow_internal_unsafe] should allow crates that forbid unsafe code to call the macro, but a crate with unsafe code forbidden shouldn't be able to use this attribute on its macros.
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=b137113f78a25cec34a258505cf41e3f
I'd like the ability to forbid the use of
unsafe_codeover all dependencies with at least a per-crate whitelist. For a quick PoC I've wrapped rustc to add--cap-lints=forbidbefore cargo's arguments and useRUSTFLAGS=-Funsafe-codeto forbid unsafe code. No per-crate (or better) whitelist there.While trying to write some async code I noticed that
await!()wasn't incore#56767, so I checked the sources to find it is instdbut uses this scary attribute.I agree
#[allow_internal_unsafe]should allow crates that forbid unsafe code to call the macro, but a crate with unsafe code forbidden shouldn't be able to use this attribute on its macros.