2017-01-20 01:17:48 -06:00
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:26:13
|
|
|
|
|
|
|
|
|
26 | fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:14:9
|
|
|
|
|
|
|
|
|
14 | #![deny(unused_unsafe)]
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:27:13
|
|
|
|
|
|
|
|
|
27 | fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:28:20
|
|
|
|
|
|
|
|
|
28 | unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` fn
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:28:1
|
|
|
|
|
|
|
|
|
28 | unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:29:13
|
|
|
|
|
|
|
|
|
29 | fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:30:20
|
|
|
|
|
|
|
|
|
30 | unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` fn
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:30:1
|
|
|
|
|
|
|
|
|
30 | unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:33:9
|
|
|
|
|
|
2017-04-14 18:38:10 -05:00
|
|
|
33 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
34 | | unsf()
|
|
|
|
35 | | }
|
2017-04-14 18:38:10 -05:00
|
|
|
| |_________^ unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` block
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:32:5
|
|
|
|
|
|
2017-04-14 18:38:10 -05:00
|
|
|
32 | / unsafe { // don't put the warning here
|
2017-01-20 01:17:48 -06:00
|
|
|
33 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
34 | | unsf()
|
|
|
|
35 | | }
|
|
|
|
36 | | }
|
2017-04-14 18:38:10 -05:00
|
|
|
| |_____^
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2017-08-30 17:18:46 -05:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:40:9
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
2017-08-30 17:18:46 -05:00
|
|
|
40 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
41 | | unsf()
|
|
|
|
42 | | }
|
2017-08-30 17:18:46 -05:00
|
|
|
| |_________^ unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` fn
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:38:1
|
|
|
|
|
|
2017-04-14 18:38:10 -05:00
|
|
|
38 | / unsafe fn bad7() {
|
2017-01-20 01:17:48 -06:00
|
|
|
39 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
41 | | unsf()
|
|
|
|
42 | | }
|
|
|
|
43 | | }
|
|
|
|
44 | | }
|
2017-04-14 18:38:10 -05:00
|
|
|
| |_^
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2017-08-30 17:18:46 -05:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:39:5
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
2017-08-30 17:18:46 -05:00
|
|
|
39 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
41 | | unsf()
|
|
|
|
42 | | }
|
2017-08-30 17:18:46 -05:00
|
|
|
43 | | }
|
|
|
|
| |_____^ unnecessary `unsafe` block
|
2017-01-20 01:17:48 -06:00
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` fn
|
|
|
|
--> $DIR/lint-unused-unsafe.rs:38:1
|
|
|
|
|
|
2017-04-14 18:38:10 -05:00
|
|
|
38 | / unsafe fn bad7() {
|
2017-01-20 01:17:48 -06:00
|
|
|
39 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
|
|
|
41 | | unsf()
|
|
|
|
42 | | }
|
|
|
|
43 | | }
|
|
|
|
44 | | }
|
2017-04-14 18:38:10 -05:00
|
|
|
| |_^
|
2017-01-20 01:17:48 -06:00
|
|
|
|
2017-07-02 05:49:30 -05:00
|
|
|
error: aborting due to 8 previous errors
|
2017-01-20 01:17:48 -06:00
|
|
|
|