File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ impl S {
10
10
11
11
async unsafe fn f ( ) { }
12
12
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
+
13
18
fn main ( ) {
14
19
S :: f ( ) ; //~ ERROR call to unsafe function is unsafe
15
20
f ( ) ; //~ ERROR call to unsafe function is unsafe
Original file line number Diff line number Diff line change @@ -14,6 +14,22 @@ LL | f();
14
14
|
15
15
= note: consult the function's documentation for information on how to avoid undefined behavior
16
16
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
18
34
19
35
For more information about this error, try `rustc --explain E0133`.
You can’t perform that action at this time.
0 commit comments