Skip to content

Commit 6e9172f

Browse files
committed
Auto merge of #66932 - rust-lang:pass-check-runfail, r=petrochenkov
Revamp `// run-fail` wrt. `--pass` & support `// build-fail` & `// check-fail` Revamp how `// run-fail` tests work internally by having a separate `FailMode` that does not interfere with `PassMode`. In particular, `--pass check` will now have no effect on `// *-fail` tests. Moreover, new test annotations `// check-fail` (the default) and `// build-fail` are added. The latter is useful to distinguish post-monomorphization failures from pre-monomorphization failures as seen throughout the PR. Finally, ensure that non-`Ui` tests do not listen to `--pass check` such that the flag can be used with e.g. `./x.py test --pass check` directly. Fixes #66929. Fixes #67128. r? @petrochenkov cc @RalfJung @ninjasource
2 parents 5535c25 + 73e6a21 commit 6e9172f

File tree

174 files changed

+613
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+613
-406
lines changed

src/test/ui/asm/issue-51431.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// build-fail
12
// ignore-emscripten no asm! support
23

34
#![feature(asm)]

src/test/ui/asm/issue-51431.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0669]: invalid value for constraint in inline assembly
2-
--> $DIR/issue-51431.rs:7:32
2+
--> $DIR/issue-51431.rs:8:32
33
|
44
LL | asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)}
55
| ^^^^

src/test/ui/bad/bad-intrinsic-monomorphization.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// build-fail
2+
13
#![feature(repr_simd, platform_intrinsics, core_intrinsics)]
24
#![allow(warnings)]
35
#![crate_type = "rlib"]

src/test/ui/bad/bad-intrinsic-monomorphization.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo`
2-
--> $DIR/bad-intrinsic-monomorphization.rs:18:5
2+
--> $DIR/bad-intrinsic-monomorphization.rs:20:5
33
|
44
LL | intrinsics::cttz(v)
55
| ^^^^^^^^^^^^^^^^^^^
66

77
error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic float type, found `Foo`
8-
--> $DIR/bad-intrinsic-monomorphization.rs:23:5
8+
--> $DIR/bad-intrinsic-monomorphization.rs:25:5
99
|
1010
LL | intrinsics::fadd_fast(a, b)
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
14-
--> $DIR/bad-intrinsic-monomorphization.rs:28:5
14+
--> $DIR/bad-intrinsic-monomorphization.rs:30:5
1515
|
1616
LL | simd_add(a, b)
1717
| ^^^^^^^^^^^^^^

src/test/ui/cdylib-deps-must-be-static.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// build-fail
12
// error-pattern: crate `cdylib_dep` required to be available in rlib format, but was not found
23
// aux-build:cdylib-dep.rs
34
// ignore-musl

src/test/ui/commandline-argfile-badutf8.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Check to see if we can get parameters from an @argsfile file
22
//
3-
// build-fail
43
// compile-flags: --cfg cmdline_set @{{src-base}}/commandline-argfile-badutf8.args
54

65
#[cfg(not(cmdline_set))]

src/test/ui/commandline-argfile-missing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Check to see if we can get parameters from an @argsfile file
22
//
33
// ignore-tidy-linelength
4-
// build-fail
54
// normalize-stderr-test: "os error \d+" -> "os error $$ERR"
65
// normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
76
// compile-flags: --cfg cmdline_set @{{src-base}}/commandline-argfile-missing.args

src/test/ui/consts/array-literal-index-oob.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// build-fail
2+
13
fn main() {
24
&{[1, 2, 3][4]};
35
//~^ ERROR index out of bounds

src/test/ui/consts/array-literal-index-oob.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: index out of bounds: the len is 3 but the index is 4
2-
--> $DIR/array-literal-index-oob.rs:2:7
2+
--> $DIR/array-literal-index-oob.rs:4:7
33
|
44
LL | &{[1, 2, 3][4]};
55
| ^^^^^^^^^^^^
66
|
77
= note: `#[deny(const_err)]` on by default
88

99
error: reaching this expression at runtime will panic or abort
10-
--> $DIR/array-literal-index-oob.rs:2:7
10+
--> $DIR/array-literal-index-oob.rs:4:7
1111
|
1212
LL | &{[1, 2, 3][4]};
1313
| --^^^^^^^^^^^^-

src/test/ui/consts/assoc_const_generic_impl.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// build-fail
2+
13
#![warn(const_err)]
24

35
trait ZeroSized: Sized {

0 commit comments

Comments
 (0)