test E0133 when calling free/impl async unsafe fn
in async fn
This commit is contained in:
parent
e65c1c44a2
commit
60f480dacb
2 changed files with 22 additions and 1 deletions
|
@ -10,6 +10,11 @@ impl S {
|
|||
|
||||
async unsafe fn f() {}
|
||||
|
||||
async fn g() {
|
||||
S::f(); //~ ERROR call to unsafe function is unsafe
|
||||
f(); //~ ERROR call to unsafe function is unsafe
|
||||
}
|
||||
|
||||
fn main() {
|
||||
S::f(); //~ ERROR call to unsafe function is unsafe
|
||||
f(); //~ ERROR call to unsafe function is unsafe
|
||||
|
|
|
@ -14,6 +14,22 @@ LL | f();
|
|||
|
|
||||
= note: consult the function's documentation for information on how to avoid undefined behavior
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
|
||||
--> $DIR/async-unsafe-fn-call-in-safe.rs:19:5
|
||||
|
|
||||
LL | S::f();
|
||||
| ^^^^^^ call to unsafe function
|
||||
|
|
||||
= note: consult the function's documentation for information on how to avoid undefined behavior
|
||||
|
||||
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
|
||||
--> $DIR/async-unsafe-fn-call-in-safe.rs:20:5
|
||||
|
|
||||
LL | f();
|
||||
| ^^^ call to unsafe function
|
||||
|
|
||||
= note: consult the function's documentation for information on how to avoid undefined behavior
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0133`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue