Skip to content

Commit

Permalink
Auto merge of #133460 - clubby789:run-fail-output, r=estebank
Browse files Browse the repository at this point in the history
Use `check-run-results` for `run-fail` test stderr

Fixes #65865
  • Loading branch information
bors committed Dec 29, 2024
2 parents 480eec0 + e1a9aff commit 2a2f01f
Show file tree
Hide file tree
Showing 362 changed files with 873 additions and 219 deletions.
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use ignore::Walk;
const ENTRY_LIMIT: u32 = 901;
// FIXME: The following limits should be reduced eventually.

const ISSUES_ENTRY_LIMIT: u32 = 1667;
const ISSUES_ENTRY_LIMIT: u32 = 1679;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/array-slice-vec/dst-raw-slice.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test bounds checking for DST raw slices

//@ run-fail
//@ error-pattern:index out of bounds
//@ check-run-results:index out of bounds
//@ ignore-emscripten no processes

#[allow(unconditional_panic)]
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/array-slice-vec/dst-raw-slice.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/dst-raw-slice.rs:11:18:
index out of bounds: the len is 3 but the index is 3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/array-slice-vec/vec-overrun.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:index out of bounds: the len is 1 but the index is 2
//@ check-run-results:index out of bounds: the len is 1 but the index is 2
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/array-slice-vec/vec-overrun.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/vec-overrun.rs:11:17:
index out of bounds: the len is 1 but the index is 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// be talking about `async fn`s instead.

//@ run-fail
//@ error-pattern: thread 'main' panicked
//@ error-pattern: `async fn` resumed after completion
//@ check-run-results: thread 'main' panicked
//@ check-run-results: `async fn` resumed after completion
//@ edition:2018

#![feature(coroutines, coroutine_trait)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-completion.rs:11:16:
`async fn` resumed after completion
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

//@ run-fail
//@ needs-unwind
//@ error-pattern: thread 'main' panicked
//@ error-pattern: `async fn` resumed after panicking
//@ check-run-results: thread 'main' panicked
//@ check-run-results: `async fn` resumed after panicking
//@ edition:2018

#![feature(coroutines, coroutine_trait)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:15:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:14:16:
`async fn` resumed after panicking
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// panic when resumed after completion.

//@ run-fail
//@ error-pattern:coroutine resumed after completion
//@ check-run-results:coroutine resumed after completion
//@ edition:2018

#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-65419-coroutine-resume-after-completion.rs:15:5:
coroutine resumed after completion
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/binop/binop-fail-3.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:quux
//@ check-run-results:quux
//@ ignore-emscripten no processes

fn foo() -> ! {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/binop/binop-fail-3.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/binop-fail-3.rs:6:5:
quux
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/binop/binop-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:quux
//@ check-run-results:quux
//@ ignore-emscripten no processes

fn my_err(s: String) -> ! {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/binop/binop-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/binop-panic.rs:7:5:
quux
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions tests/ui/binop/binop-panic.run.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bye
2 changes: 1 addition & 1 deletion tests/ui/borrowck/borrowck-local-borrow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:panic 1
//@ check-run-results:panic 1
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/borrowck/borrowck-local-borrow.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/borrowck-local-borrow.rs:8:5:
panic 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/borrowck/issue-28934.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// which were not being considered during the contraction phase.

//@ run-fail
//@ error-pattern:explicit panic
//@ check-run-results:explicit panic
//@ ignore-emscripten no processes

struct Parser<'i: 't, 't>(&'i u8, &'t u8);
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/borrowck/issue-28934.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-28934.rs:14:9:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/closures/diverging-closure.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:oops
//@ check-run-results:oops
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/closures/diverging-closure.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/diverging-closure.rs:7:9:
oops
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/consts/issue-29798.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:index out of bounds: the len is 5 but the index is 5
//@ check-run-results:index out of bounds: the len is 5 but the index is 5
//@ ignore-emscripten no processes

const fn test(x: usize) -> i32 {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/consts/issue-29798.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-29798.rs:6:5:
index out of bounds: the len is 5 but the index is 5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/coroutine/coroutine-resume-after-panic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ run-fail
//@ needs-unwind
//@ error-pattern:coroutine resumed after panicking
//@ check-run-results:coroutine resumed after panicking
//@ ignore-emscripten no processes

// Test that we get the correct message for resuming a panicked coroutine.
Expand Down
5 changes: 5 additions & 0 deletions tests/ui/coroutine/coroutine-resume-after-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:18:9:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:17:30:
coroutine resumed after panicking
2 changes: 1 addition & 1 deletion tests/ui/expr/if/expr-if-panic-fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:explicit panic
//@ check-run-results:explicit panic
//@ ignore-emscripten no processes

fn f() -> ! {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/expr/if/expr-if-panic-fn.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/expr-if-panic-fn.rs:6:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/expr/if/expr-if-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:explicit panic
//@ check-run-results:explicit panic
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/expr/if/expr-if-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/expr-if-panic.rs:9:9:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/expr/if/if-check-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:Number is odd
//@ check-run-results:Number is odd
//@ ignore-emscripten no processes

fn even(x: usize) -> bool {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/expr/if/if-check-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/if-check-panic.rs:19:9:
Number is odd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/expr/if/if-cond-bot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:quux
//@ check-run-results:quux
//@ ignore-emscripten no processes

fn my_err(s: String) -> ! {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/expr/if/if-cond-bot.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/if-cond-bot.rs:7:5:
quux
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions tests/ui/expr/if/if-cond-bot.run.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bye
2 changes: 1 addition & 1 deletion tests/ui/extern/issue-18576.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:stop
//@ check-run-results:stop
//@ ignore-emscripten no processes

// #18576
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/extern/issue-18576.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-18576.rs:11:5:
stop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/fn/expr-fn-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:explicit panic
//@ check-run-results:explicit panic
//@ ignore-emscripten no processes

fn f() -> ! {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/fn/expr-fn-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/expr-fn-panic.rs:6:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions tests/ui/hashmap/hashmap-capacity-overflow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ run-fail
//@ error-pattern:capacity overflow
//@ ignore-emscripten no processes
//@ compile-flags: --remap-path-prefix={{rust-src-base}}=remapped

use std::collections::hash_map::HashMap;
use std::mem::size_of;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/imports/glob-use-std.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Issue #7580

//@ run-fail
//@ error-pattern:panic works
//@ check-run-results:panic works
//@ ignore-emscripten no processes

use std::*;
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/imports/glob-use-std.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/glob-use-std.rs:10:5:
panic works
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-12920.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:explicit panic
//@ check-run-results:explicit panic
//@ ignore-emscripten no processes

pub fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-12920.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-12920.rs:6:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-13202.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:bad input
//@ check-run-results:bad input
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-13202.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-13202.rs:6:27:
bad input
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-20971.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regression test for Issue #20971.

//@ run-fail
//@ error-pattern:Hello, world!
//@ check-run-results:Hello, world!
//@ ignore-emscripten no processes

pub trait Parser {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-20971.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-20971.rs:18:5:
Hello, world!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-23354-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:panic evaluated
//@ check-run-results:panic evaluated
//@ ignore-emscripten no processes

#[allow(unused_variables)]
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-23354-2.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-23354-2.rs:8:14:
panic evaluated
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-23354.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:panic evaluated
//@ check-run-results:panic evaluated
//@ ignore-emscripten no processes

#[allow(unused_variables)]
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-23354.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-23354.rs:7:14:
panic evaluated
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-2761.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:custom message
//@ check-run-results:custom message
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-2761.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-2761.rs:6:5:
custom message
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-3029.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:so long
//@ check-run-results:so long
//@ ignore-emscripten no processes

#![allow(unreachable_code)]
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-3029.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-3029.rs:10:5:
so long
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-30380.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// destroyed values lying around for other destructors to observe.

//@ run-fail
//@ error-pattern:panicking destructors ftw!
//@ check-run-results:panicking destructors ftw!
//@ ignore-emscripten no processes

struct Observer<'a>(&'a mut FilledOnDrop);
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-30380.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/issue-30380.rs:17:13:
panicking destructors ftw!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-44216-add-instant.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:overflow
//@ check-run-results:overflow

use std::time::{Duration, Instant};

Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-44216-add-instant.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at library/std/src/time.rs:417:33:
overflow when adding duration to instant
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-44216-add-system-time.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:overflow
//@ check-run-results:overflow
//@ ignore-emscripten no processes

use std::time::{Duration, SystemTime};
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-44216-add-system-time.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at library/std/src/time.rs:601:31:
overflow when adding duration to instant
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-44216-sub-instant.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:overflow
//@ check-run-results:overflow
//@ ignore-emscripten no processes

use std::time::{Instant, Duration};
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-44216-sub-instant.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at library/std/src/time.rs:433:33:
overflow when subtracting duration from instant
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-44216-sub-system-time.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:overflow
//@ check-run-results:overflow
//@ ignore-emscripten no processes

use std::time::{Duration, SystemTime};
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-44216-sub-system-time.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at library/std/src/time.rs:617:31:
overflow when subtracting duration from instant
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 changes: 1 addition & 1 deletion tests/ui/loops/for-each-loop-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:moop
//@ check-run-results:moop
//@ ignore-emscripten no processes

fn main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/loops/for-each-loop-panic.run.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
thread 'main' panicked at $DIR/for-each-loop-panic.rs:7:9:
moop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Loading

0 comments on commit 2a2f01f

Please sign in to comment.