diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-24 08:55:49 -0800 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-24 12:48:01 -0800 |
| commit | a1a14096470fd96cc0ca25167623c940a1b96ce9 (patch) | |
| tree | 83d05f51e1a57e673e3f2f4d144ac031e8b798d5 /src/test/incremental/thinlto | |
| parent | b3f85fdf3350b2813af95c2946607dba771373da (diff) | |
| parent | 42df8c56cc6f1b94a9c0e8e55462dff57d95e4ac (diff) | |
| download | rust-a1a14096470fd96cc0ca25167623c940a1b96ce9.tar.gz rust-a1a14096470fd96cc0ca25167623c940a1b96ce9.zip | |
Rollup merge of #48317 - ExpHP:unused-unsafe-is-no-fn, r=estebank
unused_unsafe: don't label irrelevant fns
Fixes #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
```
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
