summaryrefslogtreecommitdiffstats
path: root/tests/ui/inline-const/expr-unsafe.rs
blob: d71efd33db16393faa706670b1d27ee07ba2732f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// check-pass
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
#![warn(unused_unsafe)]
#![feature(inline_const)]
const unsafe fn require_unsafe() -> usize { 1 }

fn main() {
    unsafe {
        const {
            require_unsafe();
            unsafe {}
            //~^ WARNING unnecessary `unsafe` block
        }
    }
}