about summary refs log tree commit diff
path: root/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
blob: b371a79d1f326abc373b36836b9b6f285c1cc704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ edition:2018

#![deny(unused_unsafe)]

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`
}