]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsafe/unsafe-fn-used-as-value.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / unsafe / unsafe-fn-used-as-value.rs
1 // revisions: mir thir
2 // [thir]compile-flags: -Z thir-unsafeck
3
4 unsafe fn f() { return; }
5
6 fn main() {
7     let x = f;
8     x();
9     //[mir]~^ ERROR call to unsafe function is unsafe
10     //[thir]~^^ ERROR call to unsafe function `f` is unsafe
11 }