-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
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.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.