Skip to content

Commit 3797b03

Browse files
Remove some errors in UI tests
As we now need to run THIR unsafeck before MIR build, errors in unsafeck can cause the compilation to be aborted earlier.
1 parent 6dfdea9 commit 3797b03

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ async fn g() {
1616
}
1717

1818
fn main() {
19-
S::f(); //~ ERROR call to unsafe function is unsafe
20-
f(); //~ ERROR call to unsafe function is unsafe
19+
S::f(); //[mir]~ ERROR call to unsafe function is unsafe
20+
f(); //[mir]~ ERROR call to unsafe function is unsafe
2121
}

src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ LL | f();
1414
|
1515
= note: consult the function's documentation for information on how to avoid undefined behavior
1616

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
17+
error: aborting due to 2 previous errors
3418

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

src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ fn main() {
99
let a: [u8; foo()];
1010
//~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
1111
foo();
12-
//~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
12+
//[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
1313
}
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
2-
--> $DIR/const-extern-fn-requires-unsafe.rs:11:5
3-
|
4-
LL | foo();
5-
| ^^^^^ call to unsafe function
6-
|
7-
= note: consult the function's documentation for information on how to avoid undefined behavior
8-
91
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
102
--> $DIR/const-extern-fn-requires-unsafe.rs:9:17
113
|
@@ -14,6 +6,6 @@ LL | let a: [u8; foo()];
146
|
157
= note: consult the function's documentation for information on how to avoid undefined behavior
168

17-
error: aborting due to 2 previous errors
9+
error: aborting due to previous error
1810

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

0 commit comments

Comments
 (0)