]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / unsafe / unsafe-around-compiler-generated-unsafe.rs
1 // edition:2018
2 // revisions: mir thir
3 // [thir]compile-flags: -Z thir-unsafeck
4
5 #![deny(unused_unsafe)]
6
7 fn main() {
8     let _ = async {
9         unsafe { async {}.await; } //~ ERROR unnecessary `unsafe`
10     };
11
12     // `format_args!` expands with a compiler-generated unsafe block
13     unsafe { println!("foo"); } //~ ERROR unnecessary `unsafe`
14 }