rust/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
384 B
Rust
Raw Normal View History

//@ edition:2018
struct S;
impl S {
async unsafe fn f() {}
}
async unsafe fn f() {}
async fn g() {
S::f();
2023-12-07 11:56:48 +00:00
//~^ ERROR call to unsafe function `S::f` is unsafe
f();
2023-12-07 11:56:48 +00:00
//~^ ERROR call to unsafe function `f` is unsafe
}
fn main() {
S::f();
2023-12-07 11:56:48 +00:00
//~^ ERROR call to unsafe function `S::f` is unsafe
f();
2023-12-07 11:56:48 +00:00
//~^ ERROR call to unsafe function `f` is unsafe
}