]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-unsafe-fn-call-in-safe.rs
Rollup merge of #107065 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / 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();
15     //[mir]~^ ERROR call to unsafe function is unsafe
16     //[thir]~^^ ERROR call to unsafe function `S::f` is unsafe
17     f();
18     //[mir]~^ ERROR call to unsafe function is unsafe
19     //[thir]~^^ ERROR call to unsafe function `f` is unsafe
20 }
21
22 fn main() {
23     S::f(); //[mir]~ ERROR call to unsafe function is unsafe
24     f(); //[mir]~ ERROR call to unsafe function is unsafe
25 }