]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
Test `-Zthir-unsafeck` for unsafe function calls
[rust.git] / src / test / ui / async-await / async-unsafe-fn-call-in-safe.rs
1 // edition:2018
2 // revisions: mir thir
3 // [thir]compile-flags: -Z thir-unsafeck
4
5 struct S;
6
7 impl S {
8     async unsafe fn f() {}
9 }
10
11 async unsafe fn f() {}
12
13 async fn g() {
14     S::f(); //~ ERROR call to unsafe function is unsafe
15     f(); //~ ERROR call to unsafe function is unsafe
16 }
17
18 fn main() {
19     S::f(); //~ ERROR call to unsafe function is unsafe
20     f(); //~ ERROR call to unsafe function is unsafe
21 }