Closed
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