-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
Seems to be a recent regression. I'm not sure what the release cycle for clippy is, but it has appreared in rustup's nightly within the last week. Maybe due to #15678?
Lint Name
undocumented_unsafe_blocks
Reproducer
I tried this code:
#![warn(clippy::undocumented_unsafe_blocks)]
unsafe fn f() {}
fn main() {
// SAFETY: trust me
#[allow(
unused // can be any lint
)]
unsafe {
f();
}
}
I saw this happen:
warning: unsafe block missing a safety comment
--> src/main.rs:10:5
|
10 | unsafe {
| ^^^^^^^^
|
= help: consider adding a safety comment on the preceding line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(clippy::undocumented_unsafe_blocks)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I expected to see this happen:
no warning
Version
clippy 0.1.92 (f04e3dfc87 2025-10-19)
Additional Labels
No response
threema-theo
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have