-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.
Description
pub unsafe fn outer() {
fn inner() {
unsafe { /* unnecessary */ }
}
inner()
}
warning: unnecessary `unsafe` block
--> src/main.rs:3:9
|
1 | pub unsafe fn outer() {
| --------------------- because it's nested under this `unsafe` fn
2 | fn inner() {
3 | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
|
= note: #[warn(unused_unsafe)] on by default
The unsafe
block is clearly unnecessary, but it being inside a safe function which is nested in an unsafe function is clearly not the reason. Playpen
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.