2019-07-12 03:32:39 +00:00
|
|
|
//@ edition:2018
|
|
|
|
|
|
|
|
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();
|
2023-12-07 11:56:48 +00:00
|
|
|
//~^ ERROR call to unsafe function `S::f` is unsafe
|
2022-04-26 10:43:00 +00:00
|
|
|
f();
|
2023-12-07 11:56:48 +00:00
|
|
|
//~^ 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();
|
2023-12-07 11:56:48 +00:00
|
|
|
//~^ ERROR call to unsafe function `S::f` is unsafe
|
2023-10-05 14:57:14 +00:00
|
|
|
f();
|
2023-12-07 11:56:48 +00:00
|
|
|
//~^ ERROR call to unsafe function `f` is unsafe
|
2019-07-12 03:32:39 +00:00
|
|
|
}
|