Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#48317 - ExpHP:unused-unsafe-is-no-fn, r=est…
…ebank unused_unsafe: don't label irrelevant fns Fixes rust-lang#48131 Diagnostic bugfix to remove an errant note. Stops the search for an enclosing unsafe scope at the first safe fn encountered. ```rust pub unsafe fn outer() { fn inner() { unsafe { /* unnecessary */ } } inner() } ``` **Before:** ``` 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 ``` **After:** ``` warning: unnecessary `unsafe` block --> src/main.rs:3:9 | 3 | unsafe { /* unnecessary */ } | ^^^^^^ unnecessary `unsafe` block | = note: #[warn(unused_unsafe)] on by default ```
- Loading branch information