2019-07-12 13:32:39 +10:00
|
|
|
// edition:2018
|
2021-03-14 20:11:37 +01:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2019-07-12 13:32:39 +10:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
async unsafe fn f() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
async unsafe fn f() {}
|
|
|
|
|
2019-07-12 14:43:52 +10:00
|
|
|
async fn g() {
|
2022-04-26 10:43:00 +00: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-12 14:43:52 +10:00
|
|
|
}
|
|
|
|
|
2019-07-12 13:32:39 +10:00
|
|
|
fn main() {
|
2022-04-26 10:43:00 +00:00
|
|
|
S::f(); //[mir]~ ERROR call to unsafe function is unsafe
|
|
|
|
f(); //[mir]~ ERROR call to unsafe function is unsafe
|
2019-07-12 13:32:39 +10:00
|
|
|
}
|