mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:21:13
|
|
|
|
|
LL | fn bad1() { unsafe {} }
|
|
| ^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/lint-unused-unsafe-thir.rs:9:9
|
|
|
|
|
LL | #![deny(unused_unsafe)]
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:22:13
|
|
|
|
|
LL | fn bad2() { unsafe { bad1() } }
|
|
| ^^^^^^ unnecessary `unsafe` block
|
|
|
|
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:23:20
|
|
|
|
|
LL | unsafe fn bad3() { unsafe {} }
|
|
| ---------------- ^^^^^^ unnecessary `unsafe` block
|
|
| |
|
|
| because it's nested under this `unsafe` fn
|
|
|
|
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:24:13
|
|
|
|
|
LL | fn bad4() { unsafe { callback(||{}) } }
|
|
| ^^^^^^ unnecessary `unsafe` block
|
|
|
|
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:28:9
|
|
|
|
|
LL | unsafe { // don't put the warning here
|
|
| ------ because it's nested under this `unsafe` block
|
|
LL | unsafe {
|
|
| ^^^^^^ unnecessary `unsafe` block
|
|
|
|
error: unnecessary `unsafe` block
|
|
--> $DIR/lint-unused-unsafe-thir.rs:35:9
|
|
|
|
|
LL | unsafe {
|
|
| ------ because it's nested under this `unsafe` block
|
|
LL | unsafe {
|
|
| ^^^^^^ unnecessary `unsafe` block
|
|
|
|
error: aborting due to 6 previous errors
|
|
|