rust/tests/ui/meta/revision-bad.rs
许杰友 Jieyou Xu (Joe) 1fe079bd62 Remap path refix in the panic message
Otherwise `error-pattern` on the test run stderr can incorrectly match
if e.g. the paths in panic backtrace has a matching substring (like if
we look for `bar` in the error pattern but username is `baron`).
2024-10-12 09:41:42 +08:00

24 lines
404 B
Rust

// Meta test for compiletest: check that when we give the wrong error
// patterns, the test fails.
//@ run-fail
//@ revisions: foo bar
//@ should-fail
//@ needs-run-enabled
//@ compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[foo] error-pattern:bar
//@[bar] error-pattern:foo
#[cfg(foo)]
fn die() {
panic!("foo");
}
#[cfg(bar)]
fn die() {
panic!("bar");
}
fn main() {
die();
}