]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
Auto merge of #94034 - willcrichton:fix-trait-suggestion-for-binops, r=estebank
[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 `S::f` is unsafe
15     f(); //~ ERROR call to unsafe function `f` is unsafe
16 }
17
18 fn main() {
19     S::f(); //[mir]~ ERROR call to unsafe function `S::f` is unsafe
20     f(); //[mir]~ ERROR call to unsafe function `f` is unsafe
21 }