rust/src/test/ui/span/lint-unused-unsafe.mir.stderr

68 lines
1.9 KiB
Plaintext
Raw Normal View History

error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:19:13
|
2019-03-09 15:03:44 +03:00
LL | fn bad1() { unsafe {} }
| ^^^^^^ unnecessary `unsafe` block
|
2020-01-22 23:57:38 +00:00
note: the lint level is defined here
--> $DIR/lint-unused-unsafe.rs:7:9
|
2018-02-23 03:42:32 +03:00
LL | #![deny(unused_unsafe)]
| ^^^^^^^^^^^^^
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:20:13
|
2019-03-09 15:03:44 +03:00
LL | fn bad2() { unsafe { bad1() } }
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:21:20
|
2019-03-09 15:03:44 +03:00
LL | unsafe fn bad3() { unsafe {} }
| ---------------- ^^^^^^ unnecessary `unsafe` block
| |
| because it's nested under this `unsafe` fn
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:22:13
|
2019-03-09 15:03:44 +03:00
LL | fn bad4() { unsafe { callback(||{}) } }
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:23:20
|
2019-03-09 15:03:44 +03:00
LL | unsafe fn bad5() { unsafe { unsf() } }
| ---------------- ^^^^^^ unnecessary `unsafe` block
| |
| because it's nested under this `unsafe` fn
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:26:9
|
2018-02-23 03:42:32 +03:00
LL | unsafe { // don't put the warning here
| ------ because it's nested under this `unsafe` block
2019-03-09 15:03:44 +03:00
LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:32:5
|
2018-02-23 03:42:32 +03:00
LL | unsafe fn bad7() {
| ---------------- because it's nested under this `unsafe` fn
2019-03-09 15:03:44 +03:00
LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:33:9
|
2018-02-23 03:42:32 +03:00
LL | unsafe fn bad7() {
| ---------------- because it's nested under this `unsafe` fn
2019-03-09 15:03:44 +03:00
LL | unsafe {
LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: aborting due to 8 previous errors