]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc
[rust.git] / src / test / 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 }