2019-07-11 22:32:39 -05:00
|
|
|
// edition:2018
|
2021-03-14 14:11:37 -05:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2019-07-11 22:32:39 -05:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
async unsafe fn f() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
async unsafe fn f() {}
|
|
|
|
|
2019-07-11 23:43:52 -05:00
|
|
|
async fn g() {
|
2022-04-26 05:43:00 -05:00
|
|
|
S::f();
|
|
|
|
//[mir]~^ ERROR call to unsafe function is unsafe
|
|
|
|
//[thir]~^^ ERROR call to unsafe function `S::f` is unsafe
|
|
|
|
f();
|
|
|
|
//[mir]~^ ERROR call to unsafe function is unsafe
|
|
|
|
//[thir]~^^ ERROR call to unsafe function `f` is unsafe
|
2019-07-11 23:43:52 -05:00
|
|
|
}
|
|
|
|
|
2019-07-11 22:32:39 -05:00
|
|
|
fn main() {
|
2022-04-26 05:43:00 -05:00
|
|
|
S::f(); //[mir]~ ERROR call to unsafe function is unsafe
|
|
|
|
f(); //[mir]~ ERROR call to unsafe function is unsafe
|
2019-07-11 22:32:39 -05:00
|
|
|
}
|