mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-01 07:13:24 +03:00
Add unnecessary unsafe test
This commit is contained in:
@@ -10,5 +10,11 @@ note: the lint level is defined here
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5
|
||||
|
|
||||
LL | unsafe { println!("foo"); }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -8,4 +8,7 @@ fn main() {
|
||||
let _ = async {
|
||||
unsafe { async {}.await; } //~ ERROR unnecessary `unsafe`
|
||||
};
|
||||
|
||||
// `format_args!` expands with a compiler-generated unsafe block
|
||||
unsafe { println!("foo"); } //~ ERROR unnecessary `unsafe`
|
||||
}
|
||||
|
||||
@@ -10,5 +10,11 @@ note: the lint level is defined here
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5
|
||||
|
|
||||
LL | unsafe { println!("foo"); }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user