Test -Zthir-unsafeck
for unused unsafe blocks
This commit is contained in:
parent
a95b342f02
commit
d5ea294114
@ -1,17 +1,17 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-48131.rs:9:9
|
||||
--> $DIR/issue-48131.rs:12:9
|
||||
|
|
||||
LL | unsafe { /* unnecessary */ }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-48131.rs:3:9
|
||||
--> $DIR/issue-48131.rs:6:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-48131.rs:20:13
|
||||
--> $DIR/issue-48131.rs:23:13
|
||||
|
|
||||
LL | unsafe { /* unnecessary */ }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
@ -1,3 +1,6 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
// This note is annotated because the purpose of the test
|
||||
// is to ensure that certain other notes are not generated.
|
||||
#![deny(unused_unsafe)] //~ NOTE
|
||||
|
20
src/test/ui/issues/issue-48131.thir.stderr
Normal file
20
src/test/ui/issues/issue-48131.thir.stderr
Normal file
@ -0,0 +1,20 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-48131.rs:12:9
|
||||
|
|
||||
LL | unsafe { /* unnecessary */ }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-48131.rs:6:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-48131.rs:23:13
|
||||
|
|
||||
LL | unsafe { /* unnecessary */ }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,11 +1,11 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:6:5
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:9:5
|
||||
|
|
||||
LL | unsafe { println!("foo"); }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:3:9
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:6:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
@ -1,5 +1,8 @@
|
||||
// issue #12418
|
||||
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![deny(unused_unsafe)]
|
||||
|
||||
fn main() {
|
||||
|
@ -0,0 +1,14 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:9:5
|
||||
|
|
||||
LL | unsafe { println!("foo"); }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:6:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user