Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test E0133 when calling free/impl async unsafe fn in async fn
  • Loading branch information
delan committed Jul 12, 2019
commit 60f480dacbc4ee0dbe5bd7dfa6efe0458ea6aab2
5 changes: 5 additions & 0 deletions src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion src/test/ui/async-await/async-unsafe-fn-call-in-safe.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`.