Skip to content

Commit 3b27b4f

Browse files
committed
Auto merge of #59769 - RalfJung:compiletest-normalization, r=alexcrichton
compiletest normalization: preserve non-JSON lines such as ICEs Currently, every non-JSON line from stderr gets normalized away when compiletest normalizes the output. In particular, ICEs get normalized to the empty output. That does not seem desirable, so this changes normalization to preserve non-JSON lines instead. Also see Manishearth/compiletest-rs#169: because of that bug, Miri currently *looks* green in the toolstate, but some tests ICE. That same bug is likely no longer present in latest compiletest because the error code gets checked separately, but it still seems like a good idea to also make sure that ICEs are considered stderr output: This change found an accidental user-visible `error!` in CTFE validation (fixed), and a non-deterministic panic when there are two `main` symbols (not fixed, no idea where this comes from). Both got missed before because non-JSON output got ignored.
2 parents a7cef0b + 28c4397 commit 3b27b4f

30 files changed

+92
-10
lines changed

src/librustc_mir/interpret/validity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ impl<'rt, 'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>>
353353
match self.ecx.memory.check_align(ptr, align) {
354354
Ok(_) => {},
355355
Err(err) => {
356-
error!("{:?} is not aligned to {:?}", ptr, align);
356+
info!("{:?} is not aligned to {:?}", ptr, align);
357357
match err.kind {
358358
InterpError::InvalidNullPointerUsage =>
359359
return validation_failure!("NULL reference", self.path),

src/test/run-pass/backtrace-debuginfo.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
// ignore-pretty issue #37195
1111
// ignore-cloudabi spawning processes is not supported
1212
// ignore-emscripten spawning processes is not supported
13+
// normalize-stderr-test ".*\n" -> ""
1314

14-
// note that above `-opt-bisect-limit=0` is used to basically disable
15-
// optimizations
15+
// Note that above `-opt-bisect-limit=0` is used to basically disable
16+
// optimizations. It creates tons of output on stderr, hence we normalize
17+
// that away entirely.
1618

1719
use std::env;
1820

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`)
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `a::b` (argument key must be an identifier)
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `a=10` (argument value must be a string)
2+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: invalid `--cfg` argument: `""` (expected `key` or `key="value"`)
2+

src/test/ui/duplicate/dupe-symbols-7.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
//
22
// error-pattern: entry symbol `main` defined multiple times
3+
4+
// FIXME https://github.com/rust-lang/rust/issues/59774
5+
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
6+
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
37
#![allow(warnings)]
48

59
#[no_mangle]

src/test/ui/duplicate/dupe-symbols-7.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: entry symbol `main` defined multiple times
2-
--> $DIR/dupe-symbols-7.rs:6:1
2+
--> $DIR/dupe-symbols-7.rs:10:1
33
|
44
LL | fn main(){}
55
| ^^^^^^^^^^^

0 commit comments

Comments
 (0)