2019-07-12 03:32:39 +00:00
|
|
|
// edition:2018
|
2021-03-14 19:11:37 +00:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2019-07-12 03:32:39 +00:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
async unsafe fn f() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
async unsafe fn f() {}
|
|
|
|
|
2019-07-12 04:43:52 +00: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 04:43:52 +00:00
|
|
|
}
|
|
|
|
|
2019-07-12 03:32:39 +00:00
|
|
|
fn main() {
|
2023-10-05 14:57:14 +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 03:32:39 +00:00
|
|
|
}
|