Skip to content

Selectively replace instances of error-pattern with check-run-results #143537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/ui/array-slice-vec/bounds-check-no-overflow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:index out of bounds
//@ check-run-results
//@ needs-subprocess

use std::mem::size_of;
Comment on lines 1 to 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: More concretely, I think we cannot attempt to capture run-time panic output, because the backtrace mechanism, std line numbers of underlying panic impls / macros, etc. can change between targets and is prone to breaking.

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
//@ needs-subprocess

#[allow(unconditional_panic)]
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// be talking about `async fn`s instead.

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

#![feature(coroutines, coroutine_trait)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

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

#![feature(coroutines, coroutine_trait)]
Expand Down
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
//@ edition:2018

#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
Expand Down
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
//@ needs-subprocess

fn foo() -> ! {
Expand Down
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
//@ needs-subprocess

fn my_err(s: String) -> ! {
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
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
//@ needs-subprocess

struct Parser<'i: 't, 't>(&'i u8, &'t u8);
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
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
//@ needs-subprocess

const fn test(x: usize) -> i32 {
Expand Down
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
//@ needs-subprocess

// Test that we get the correct message for resuming a panicked coroutine.
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/errors/remap-path-prefix-reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//@ [remapped-self] remap-src-base

// Verify that the expected source code is shown.
//@ error-pattern: pub struct SomeStruct {} // This line should be show
Comment on lines 8 to -9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: for tests like this, I believe it's intentional that we do not snapshot exact run output, because the exact paths themselves are not important but rather it's

The actual error is irrelevant. The important part it that is should show a snippet of the dependency's source.

//@ check-run-results

extern crate remapped_dep;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/expr/copy.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// FLUFFY
//@ run-pass

fn f(arg: &mut A) {
Expand Down
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
//@ needs-subprocess

fn f() -> ! {
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
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
//@ needs-subprocess

fn even(x: usize) -> bool {
Expand Down
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
//@ needs-subprocess

fn my_err(s: String) -> ! {
Expand Down
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
//@ needs-subprocess

// #18576
Expand Down
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
//@ needs-subprocess

fn f() -> ! {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//@ error-pattern: r#T: 'static
//@ error-pattern: r#K: 'static
//@ error-pattern: T: 'static=
//@ check-run-results

// https://github.com/rust-lang/rust/issues/124785

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
//@ needs-subprocess

use std::*;
Expand Down
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
//@ needs-subprocess

pub fn main() {
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
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
//@ needs-subprocess

pub trait Parser {
Expand Down
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
//@ needs-subprocess

#[allow(unused_variables)]
Expand Down
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
//@ needs-subprocess

#[allow(unused_variables)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-2470-bounds-check-overflow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:index out of bounds
//@ check-run-results
//@ needs-subprocess

use std::mem;
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
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
//@ needs-subprocess

#![allow(unreachable_code)]
Expand Down
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
//@ needs-subprocess

struct Observer<'a>(&'a mut FilledOnDrop);
Expand Down
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

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

Expand Down
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
//@ needs-subprocess

use std::time::{Duration, SystemTime};
Expand Down
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
//@ needs-subprocess

use std::time::{Instant, Duration};
Expand Down
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
//@ needs-subprocess

use std::time::{Duration, SystemTime};
Expand Down
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
//@ needs-subprocess

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ run-fail
//@ compile-flags: -C opt-level=3
//@ error-pattern: index out of bounds: the len is 0 but the index is 16777216
//@ check-run-results

fn do_test(x: usize) {
let mut arr = vec![vec![0u8; 3]];
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/loops/issue-69225-layout-repeated-checked-add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//@ run-fail
//@ compile-flags: -C opt-level=3
//@ error-pattern: index out of bounds: the len is 0 but the index is 16777216
//@ check-run-results

fn do_test(x: usize) {
let arr = vec![vec![0u8; 3]];
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/assert-as-macro.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:assertion failed: 1 == 2
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/macros/assert-eq-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ run-fail
//@ error-pattern:assertion `left == right` failed: 1 + 1 definitely should be 3
//@ error-pattern: left: 2
//@ error-pattern: right: 3
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/macros/assert-eq-macro-panic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ run-fail
//@ error-pattern:assertion `left == right` failed
//@ error-pattern: left: 14
//@ error-pattern: right: 15
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/assert-macro-explicit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:assertion failed: false
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/macros/assert-macro-fmt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-fail
//@ error-pattern: panicked
//@ error-pattern: test-assert-fmt 42 rust
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/macros/assert-macro-owned.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-fail
//@ error-pattern:panicked
//@ error-pattern:test-assert-owned
//@ check-run-results
//@ needs-subprocess

#![allow(non_fmt_panics)]
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/macros/assert-macro-static.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-fail
//@ error-pattern:panicked
//@ error-pattern:test-assert-static
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/macros/assert-matches-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ run-fail
//@ error-pattern:assertion `left matches right` failed: 1 + 1 definitely should be 3
//@ error-pattern: left: 2
//@ error-pattern: right: 3
Comment on lines -2 to -4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: for example, I believe this intentionally does not try to capture full run output, because the exact panic does not matter, and only the core substrings do matter.

//@ check-run-results
//@ needs-subprocess

#![feature(assert_matches)]
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/macros/assert-ne-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ run-fail
//@ error-pattern:assertion `left != right` failed: 1 + 1 definitely should not be 2
//@ error-pattern: left: 2
//@ error-pattern: right: 2
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/macros/assert-ne-macro-panic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ run-fail
//@ error-pattern:assertion `left != right` failed
//@ error-pattern: left: 14
//@ error-pattern: right: 14
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/borrowck-error-in-macro.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ aux-build: borrowck-error-in-macro.rs
//@ error-pattern: a call in this macro requires a mutable binding due to mutable borrow of `d`
//@ check-run-results
//FIXME: remove error-pattern (see #141896)
Comment on lines -2 to 3
Copy link
Member

@jieyouxu jieyouxu Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: I want to say this can be

//~? a call in this macro requires a mutable binding due to mutable borrow of `d`

but I think //~? had limitations in that it only matched on rustc check/build output?


extern crate borrowck_error_in_macro as a;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/die-macro-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:test
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/die-macro-expr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ run-fail
//@ error-pattern:test
//@ check-run-results
//@ needs-subprocess

fn main() {
Expand Down
Loading
Loading