Skip to content

Commit

Permalink
Remove some errors in UI tests
Browse files Browse the repository at this point in the history
As we now need to run THIR unsafeck before MIR build, errors in unsafeck can cause the compilation to be aborted earlier.
  • Loading branch information
LeSeulArtichaut committed May 22, 2021
1 parent 6dfdea9 commit 3797b03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
Expand Up @@ -16,6 +16,6 @@ async fn g() {
}

fn main() {
S::f(); //~ ERROR call to unsafe function is unsafe
f(); //~ ERROR call to unsafe function is unsafe
S::f(); //[mir]~ ERROR call to unsafe function is unsafe
f(); //[mir]~ ERROR call to unsafe function is unsafe
}
18 changes: 1 addition & 17 deletions src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
Expand Up @@ -14,22 +14,6 @@ LL | f();
|
= 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: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
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0133`.
Expand Up @@ -9,5 +9,5 @@ fn main() {
let a: [u8; foo()];
//~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
foo();
//~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
//[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
}
@@ -1,11 +1,3 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/const-extern-fn-requires-unsafe.rs:11:5
|
LL | foo();
| ^^^^^ 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/const-extern-fn-requires-unsafe.rs:9:17
|
Expand All @@ -14,6 +6,6 @@ LL | let a: [u8; foo()];
|
= note: consult the function's documentation for information on how to avoid undefined behavior

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0133`.

0 comments on commit 3797b03

Please sign in to comment.