File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ impl S {
1010
1111async unsafe fn f ( ) { }
1212
13+ async fn g ( ) {
14+ S :: f ( ) ; //~ ERROR call to unsafe function is unsafe
15+ f ( ) ; //~ ERROR call to unsafe function is unsafe
16+ }
17+
1318fn main ( ) {
1419 S :: f ( ) ; //~ ERROR call to unsafe function is unsafe
1520 f ( ) ; //~ ERROR call to unsafe function is unsafe
Original file line number Diff line number Diff line change @@ -14,6 +14,22 @@ LL | f();
1414 |
1515 = note: consult the function's documentation for information on how to avoid undefined behavior
1616
17- error: aborting due to 2 previous errors
17+ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
18+ --> $DIR/async-unsafe-fn-call-in-safe.rs:19:5
19+ |
20+ LL | S::f();
21+ | ^^^^^^ call to unsafe function
22+ |
23+ = note: consult the function's documentation for information on how to avoid undefined behavior
24+
25+ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
26+ --> $DIR/async-unsafe-fn-call-in-safe.rs:20:5
27+ |
28+ LL | f();
29+ | ^^^ call to unsafe function
30+ |
31+ = note: consult the function's documentation for information on how to avoid undefined behavior
32+
33+ error: aborting due to 4 previous errors
1834
1935For more information about this error, try `rustc --explain E0133`.
You can’t perform that action at this time.
0 commit comments