Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Outside of CI, don't show the full rustc command unless --verbose is passed. - Outside of CI, only show one of the diff and the full stderr. The heuristic for whether to show the diff is: - it takes up less than 10 lines, or - it takes up less than a tenth of the total stderr output - If we show the diff, also show the difference between the normalized output and the actual output for lines which didn't match. before: ``` failures: ---- [ui] tests/ui/layout/enum.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui/layout/enum/enum.stderr" diff of stderr: - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN } + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } 2 --> $DIR/enum.rs:9:1 3 | 4 LL | enum UninhabitedVariantAlign { The actual stderr differed from the expected stderr. To update references, rerun the tests and pass the `--bless` flag To only update this specific test, also pass `--test-args layout/enum.rs` error: 1 errors occurred comparing output. status: exit status: 1 command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/home/jyn/src/rust2/tests/ui/layout/enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/jyn/.local/lib/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/jyn/src/rust2/vendor" "--sysroot" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui/layout/enum" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" stdout: none --- stderr ------------------------------- error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: Align(8 bytes) } --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:9:1 | LL | enum UninhabitedVariantAlign { //~ERROR: abi: Align(2 bytes) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: size: Size(16 bytes) --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:15:1 | LL | enum UninhabitedVariantSpace { //~ERROR: size: Size(16 bytes) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: abi: ScalarPair(Initialized { value: Int(I8, false), valid_range: 0..=1 }, Initialized { value: Int(I8, false), valid_range: 0..=255 }) --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:21:1 | LL | enum ScalarPairDifferingSign { //~ERROR: abi: ScalarPair | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors ------------------------------------------ failures: [ui] tests/ui/layout/enum.rs ``` after: ``` failures: ---- [ui] tests/ui/layout/enum.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui/layout/enum/enum.stderr" diff of stderr: - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN } + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } 2 --> $DIR/enum.rs:9:1 3 | 4 LL | enum UninhabitedVariantAlign { Note: some mismatched output was normalized before being compared - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: Align(8 bytes) } - --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:9:1 + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN } The actual stderr differed from the expected stderr. To update references, rerun the tests and pass the `--bless` flag To only update this specific test, also pass `--test-args layout/enum.rs` error: 1 errors occurred comparing output. failures: [ui] tests/ui/layout/enum.rs [ui] tests/ui/proc-macro/load-panic-backtrace.rs ```
- Loading branch information