Closed
Description
Today, the unsafe_code
lint documentation https://doc.rust-lang.org/nightly/rustc/lints/listing/allowed-by-default.html#unsafe-code only mentions that it catches unsafe
blocks.
But it actually catches more than that, for example
error: declaration of a `no_mangle` function
--> src/lib.rs:3:1
|
3 | #[no_mangle]
| ^^^^^^^^^^^^
|
= note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
note: the lint level is defined here
--> src/lib.rs:1:11
|
1 | #![forbid(unsafe_code)]
| ^^^^^^^^^^^
It would be nice for the documentation to include examples of those other things that the lint catches because they might result in unsoundness despite the unsafe
token not appearing in them.