File tree Expand file tree Collapse file tree 3 files changed +11
-19
lines changed
Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,7 @@ error: unnecessary `unsafe` block
2020 --> $DIR/lint-unused-unsafe.rs:21:20
2121 |
2222LL | unsafe fn bad3() { unsafe {} }
23- | ---------------- ^^^^^^ unnecessary `unsafe` block
24- | |
25- | because it's nested under this `unsafe` fn
23+ | ^^^^^^ unnecessary `unsafe` block
2624
2725error: unnecessary `unsafe` block
2826 --> $DIR/lint-unused-unsafe.rs:22:13
@@ -39,18 +37,14 @@ LL | unsafe fn bad5() { unsafe { unsf() } }
3937 | because it's nested under this `unsafe` fn
4038
4139error: unnecessary `unsafe` block
42- --> $DIR/lint-unused-unsafe.rs:26:9
40+ --> $DIR/lint-unused-unsafe.rs:25:5
4341 |
44- LL | unsafe { // don't put the warning here
45- | ------ because it's nested under this `unsafe` block
46- LL | unsafe {
47- | ^^^^^^ unnecessary `unsafe` block
42+ LL | unsafe {
43+ | ^^^^^^ unnecessary `unsafe` block
4844
4945error: unnecessary `unsafe` block
5046 --> $DIR/lint-unused-unsafe.rs:32:5
5147 |
52- LL | unsafe fn bad7() {
53- | ---------------- because it's nested under this `unsafe` fn
5448LL | unsafe {
5549 | ^^^^^^ unnecessary `unsafe` block
5650
Original file line number Diff line number Diff line change 11// Exercise the unused_unsafe attribute in some positive and negative cases
22
3- // revisions: mir thir
4- // [thir]compile-flags: -Zthir-unsafeck
5-
3+ // revisions: mir
4+ // // revisions: mir thir
5+ // // [thir]compile-flags: -Zthir-unsafeck
66#![ allow( dead_code) ]
77#![ deny( unused_unsafe) ]
88
@@ -22,8 +22,8 @@ unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
2222fn bad4 ( ) { unsafe { callback ( ||{ } ) } } //~ ERROR: unnecessary `unsafe` block
2323unsafe fn bad5 ( ) { unsafe { unsf ( ) } } //~ ERROR: unnecessary `unsafe` block
2424fn bad6 ( ) {
25- unsafe { // don't put the warning here
26- unsafe { //~ ERROR: unnecessary `unsafe` block
25+ unsafe { //~ ERROR: unnecessary `unsafe` block
26+ unsafe { // don't put the warning here
2727 unsf ( )
2828 }
2929 }
Original file line number Diff line number Diff line change @@ -76,12 +76,10 @@ LL | unsafe {}
7676 | ^^^^^^ unnecessary `unsafe` block
7777
7878error: unnecessary `unsafe` block
79- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:47:14
79+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:47:5
8080 |
8181LL | unsafe { unsafe { unsf() } }
82- | ------ ^^^^^^ unnecessary `unsafe` block
83- | |
84- | because it's nested under this `unsafe` block
82+ | ^^^^^^ unnecessary `unsafe` block
8583
8684error: unnecessary `unsafe` block
8785 --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:58:5
You can’t perform that action at this time.
0 commit comments