diff options
Diffstat (limited to 'src')
51 files changed, 130 insertions, 80 deletions
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index f6653ed899b..f931aae3c2e 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -84,7 +84,7 @@ impl Step for Std { Kind::Check, ); - std_cargo(builder, target, stage, &mut cargo); + std_cargo(builder, target, &mut cargo); if matches!(builder.config.cmd, Subcommand::Fix) { // By default, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot. cargo.arg("--lib"); @@ -125,7 +125,7 @@ impl Step for Std { Kind::Check, ); - std_cargo(builder, target, build_compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); // Explicitly pass -p for all dependencies krates -- this will force cargo // to also check the tests/benches/examples for these crates, rather diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs index b119f2dc3ce..93c767bdd25 100644 --- a/src/bootstrap/src/core/build_steps/clippy.rs +++ b/src/bootstrap/src/core/build_steps/clippy.rs @@ -154,7 +154,7 @@ impl Step for Std { Kind::Clippy, ); - std_cargo(builder, target, compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); for krate in &*self.crates { cargo.arg("-p").arg(krate); diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 95707e37018..7039f31cdde 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -269,7 +269,7 @@ impl Step for Std { target, Kind::Build, ); - std_cargo(builder, target, compiler.stage, &mut cargo); + std_cargo(builder, target, &mut cargo); for krate in &*self.crates { cargo.arg("-p").arg(krate); } @@ -497,7 +497,7 @@ fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf { /// Configure cargo to compile the standard library, adding appropriate env vars /// and such. -pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) { +pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Cargo) { // rustc already ensures that it builds with the minimum deployment // target, so ideally we shouldn't need to do anything here. // @@ -645,12 +645,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // built with bitcode so that the produced rlibs can be used for both LTO // builds (which use bitcode) and non-LTO builds (which use object code). // So we override the override here! - // - // But we don't bother for the stage 0 compiler because it's never used - // with LTO. - if stage >= 1 { - cargo.rustflag("-Cembed-bitcode=yes"); - } + cargo.rustflag("-Cembed-bitcode=yes"); + if builder.config.rust_lto == RustcLto::Off { cargo.rustflag("-Clto=off"); } diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index d4539a0eb34..9f3524905d7 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -722,7 +722,7 @@ fn doc_std( let mut cargo = builder::Cargo::new(builder, compiler, Mode::Std, SourceType::InTree, target, Kind::Doc); - compile::std_cargo(builder, target, compiler.stage, &mut cargo); + compile::std_cargo(builder, target, &mut cargo); cargo .arg("--no-deps") .arg("--target-dir") diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index c842a17cbc8..34d50b1dccd 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2846,7 +2846,7 @@ impl Step for Crate { .arg("--manifest-path") .arg(builder.src.join("library/sysroot/Cargo.toml")); } else { - compile::std_cargo(builder, target, compiler.stage, &mut cargo); + compile::std_cargo(builder, target, &mut cargo); } } Mode::Rustc => { diff --git a/src/doc/rustc-dev-guide/src/stability.md b/src/doc/rustc-dev-guide/src/stability.md index d0cee54adb6..c26d34273d7 100644 --- a/src/doc/rustc-dev-guide/src/stability.md +++ b/src/doc/rustc-dev-guide/src/stability.md @@ -181,4 +181,7 @@ the `deprecated_in_future` lint is triggered which is default `allow`, but most of the standard library raises it to a warning with `#![warn(deprecated_in_future)]`. +## unstable_feature_bound +The `#[unstable_feature_bound(foo)]` attribute can be used together with `#[unstable]` attribute to mark an `impl` of stable type and stable trait as unstable. In std/core, an item annotated with `#[unstable_feature_bound(foo)]` can only be used by another item that is also annotated with `#[unstable_feature_bound(foo)]`. Outside of std/core, using an item with `#[unstable_feature_bound(foo)]` requires the feature to be enabled with `#![feature(foo)]` attribute on the crate. Currently, only `impl`s and free functions can be annotated with `#[unstable_feature_bound]`. + [blog]: https://www.ralfj.de/blog/2018/07/19/const.html diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 782311e593b..26b087feb16 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -480,10 +480,28 @@ impl Item { } } + /// If the item has doc comments from a reexport, returns the item id of that reexport, + /// otherwise returns returns the item id. + /// + /// This is used as a key for caching intra-doc link resolution, + /// to prevent two reexports of the same item from using the same cache. + pub(crate) fn item_or_reexport_id(&self) -> ItemId { + // added documentation on a reexport is always prepended. + self.attrs + .doc_strings + .first() + .map(|x| x.item_id) + .flatten() + .map(ItemId::from) + .unwrap_or(self.item_id) + } + pub(crate) fn links(&self, cx: &Context<'_>) -> Vec<RenderedLink> { use crate::html::format::{href, link_tooltip}; - let Some(links) = cx.cache().intra_doc_links.get(&self.item_id) else { return vec![] }; + let Some(links) = cx.cache().intra_doc_links.get(&self.item_or_reexport_id()) else { + return vec![]; + }; links .iter() .filter_map(|ItemLink { link: s, link_text, page_id: id, fragment }| { diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index fed4296fa22..c52c7236883 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -804,8 +804,7 @@ impl Options { let scrape_examples_options = ScrapeExamplesOptions::new(matches, dcx); let with_examples = matches.opt_strs("with-examples"); - let call_locations = - crate::scrape_examples::load_call_locations(with_examples, dcx, &mut loaded_paths); + let call_locations = crate::scrape_examples::load_call_locations(with_examples, dcx); let doctest_build_args = matches.opt_strs("doctest-build-arg"); let unstable_features = diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 99b3da8b2cd..c48863b4681 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1838,6 +1838,10 @@ instead, we check that it's not a "finger" cursor. border-right: 3px solid var(--target-border-color); } +a.tooltip { + font-family: var(--font-family); +} + .code-header a.tooltip { color: inherit; margin-right: 15px; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index c9fa3a4837f..bcb676cd1f1 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1082,7 +1082,12 @@ impl LinkCollector<'_, '_> { for md_link in preprocessed_markdown_links(&doc) { let link = self.resolve_link(&doc, item, item_id, module_id, &md_link); if let Some(link) = link { - self.cx.cache.intra_doc_links.entry(item.item_id).or_default().insert(link); + self.cx + .cache + .intra_doc_links + .entry(item.item_or_reexport_id()) + .or_default() + .insert(link); } } } diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs index 4d29c74e1eb..9f71d6ae789 100644 --- a/src/librustdoc/scrape_examples.rs +++ b/src/librustdoc/scrape_examples.rs @@ -333,11 +333,14 @@ pub(crate) fn run( pub(crate) fn load_call_locations( with_examples: Vec<String>, dcx: DiagCtxtHandle<'_>, - loaded_paths: &mut Vec<PathBuf>, ) -> AllCallLocations { let mut all_calls: AllCallLocations = FxIndexMap::default(); for path in with_examples { - loaded_paths.push(path.clone().into()); + // FIXME: Figure out why this line is causing this feature to crash in specific contexts. + // Full issue backlog is available here: <https://github.com/rust-lang/rust/pull/144600>. + // + // Can be checked with `tests/run-make/rustdoc-scrape-examples-paths`. + // loaded_paths.push(path.clone().into()); let bytes = match fs::read(&path) { Ok(bytes) => bytes, Err(e) => dcx.fatal(format!("failed to load examples: {e}")), diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 35670ba89e9..f283a625f97 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -356,7 +356,7 @@ impl<'test> TestCx<'test> { if proc_res.status.success() { let err = &format!("{} test did not emit an error", self.config.mode); let extra_note = (self.config.mode == crate::common::TestMode::Ui) - .then_some("note: by default, ui tests are expected not to compile"); + .then_some("note: by default, ui tests are expected not to compile.\nhint: use check-pass, build-pass, or run-pass directive to change this behavior."); self.fatal_proc_rec_general(err, extra_note, proc_res, || ()); } @@ -2567,6 +2567,11 @@ impl<'test> TestCx<'test> { }) .into_owned(); + // Normalize thread IDs in panic messages + normalized = static_regex!(r"thread '(?P<name>.*?)' \((rtid )?\d+\) panicked") + .replace_all(&normalized, "thread '$name' ($$TID) panicked") + .into_owned(); + normalized = normalized.replace("\t", "\\t"); // makes tabs visible // Remove test annotations like `//~ ERROR text` from the output, diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr index 9e6abf219f1..afabb8572bd 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index 14b3be02a79..1246ad5a713 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -1,10 +1,10 @@ -thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index 14b3be02a79..1246ad5a713 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -1,10 +1,10 @@ -thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr index 5a3d5b4a5eb..e755b262474 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr index 93720ca7d27..77dc2c61e26 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/abort_unwind.stderr b/src/tools/miri/tests/fail/panic/abort_unwind.stderr index 35052f37dfc..09f19a6e494 100644 --- a/src/tools/miri/tests/fail/panic/abort_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/abort_unwind.stderr @@ -1,10 +1,10 @@ -thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/abort_unwind.rs:LL:CC: PANIC!!! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr index b8404c4e457..b0a8492b6a6 100644 --- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/bad_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr index 3f1fbfef721..f6aa0a34749 100644 --- a/src/tools/miri/tests/fail/panic/double_panic.stderr +++ b/src/tools/miri/tests/fail/panic/double_panic.stderr @@ -1,14 +1,14 @@ -thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/double_panic.rs:LL:CC: first note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/double_panic.rs:LL:CC: second stack backtrace: -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr index 9aca2ed654f..ebdf57f0f03 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/panic_abort1.rs:LL:CC: panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr index 425817d5f86..d63e4ed79b2 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/panic_abort2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr index a21e185219e..9751053396a 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/panic_abort3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr index a3cf5d72198..a84824fcc81 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/panic/panic_abort4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr index 1dcdb4a3996..ef87e7fe6db 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr @@ -1,5 +1,5 @@ -thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC: +thread $NAME ($TID) panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop, aborting error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr index 7e4907abd93..4fdaa97e1d0 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr @@ -1,5 +1,5 @@ -thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC: +thread $NAME ($TID) panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop, aborting error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr b/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr index 8295a581060..d2b557f13f3 100644 --- a/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr +++ b/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC: unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety. diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index f0f305d76bc..96df302c397 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -1,12 +1,12 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best. -thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/terminate-terminator.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr index 216ae84512a..06c63c70ede 100644 --- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr +++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr @@ -1,10 +1,10 @@ -thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC: +thread 'main' ($TID) panicked at tests/fail/unwind-action-terminate.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr index 2be06968321..ad2bfc3f2a3 100644 --- a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr +++ b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC: alloc error hook called note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr index ddee4fd6ce3..7c2d089f952 100644 --- a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr +++ b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/std/src/alloc.rs:LL:CC: memory allocation of 4 bytes failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr index 4d4b0062d5e..013f3cd3c20 100644 --- a/src/tools/miri/tests/panic/div-by-zero-2.stderr +++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/div-by-zero-2.rs:LL:CC: attempt to divide by zero note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr index 8bcd635e8be..dad94377d12 100644 --- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr +++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr @@ -1,11 +1,11 @@ -thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic -thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic diff --git a/src/tools/miri/tests/panic/mir-validation.rs b/src/tools/miri/tests/panic/mir-validation.rs index e4b75cccbb5..b9097f2e8c5 100644 --- a/src/tools/miri/tests/panic/mir-validation.rs +++ b/src/tools/miri/tests/panic/mir-validation.rs @@ -8,6 +8,12 @@ // Somehow on rustc Windows CI, the "Miri caused an ICE" message is not shown // and we don't even get a regular panic; rustc aborts with a different exit code instead. //@ignore-host: windows + +// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard +// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump. +// For the grep: cfg(bootstrap) +//@normalize-stderr-test: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked" + #![feature(custom_mir, core_intrinsics)] use core::intrinsics::mir::*; diff --git a/src/tools/miri/tests/panic/mir-validation.stderr b/src/tools/miri/tests/panic/mir-validation.stderr index f801ac907e6..1d40c93d709 100644 --- a/src/tools/miri/tests/panic/mir-validation.stderr +++ b/src/tools/miri/tests/panic/mir-validation.stderr @@ -6,7 +6,7 @@ LL | *(tuple.0) = 1; | ^^^^^^^^^^^^^^ -thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC: +thread 'rustc' ($TID) panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC: Box<dyn Any> stack backtrace: diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr index c0dabaff772..f8270f4ad4d 100644 --- a/src/tools/miri/tests/panic/oob_subslice.stderr +++ b/src/tools/miri/tests/panic/oob_subslice.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/oob_subslice.rs:LL:CC: range end index 5 out of range for slice of length 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr index d674e2beb8d..8e618b978ef 100644 --- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr +++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC: attempt to shift left with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr index bb94f2e12c4..471bc849abb 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-1.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr index 0a29a57f3e1..94f5fb0f1ca 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-2.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr index 130bc7737a4..9ca5234dd03 100644 --- a/src/tools/miri/tests/panic/panic1.stderr +++ b/src/tools/miri/tests/panic/panic1.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/panic1.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/panic1.rs:LL:CC: panicking from libstd stack backtrace: 0: std::panicking::begin_panic_handler diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr index 157ffdb6b5d..c2e55178333 100644 --- a/src/tools/miri/tests/panic/panic2.stderr +++ b/src/tools/miri/tests/panic/panic2.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/panic2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/panic2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr index 529ef70870b..2fc761a4f3d 100644 --- a/src/tools/miri/tests/panic/panic3.stderr +++ b/src/tools/miri/tests/panic/panic3.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/panic3.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/panic3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr index ecd07dd7ded..f2f4c038000 100644 --- a/src/tools/miri/tests/panic/panic4.stderr +++ b/src/tools/miri/tests/panic/panic4.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/panic4.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/panic4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr index 71e2d7a8208..8846c4c7fbc 100644 --- a/src/tools/miri/tests/panic/transmute_fat2.stderr +++ b/src/tools/miri/tests/panic/transmute_fat2.stderr @@ -1,5 +1,5 @@ -thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC: +thread 'main' ($TID) panicked at tests/panic/transmute_fat2.rs:LL:CC: index out of bounds: the len is 0 but the index is 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr index bc745fca578..cd7384fb107 100644 --- a/src/tools/miri/tests/pass/panic/catch_panic.stderr +++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr @@ -1,47 +1,47 @@ -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect Caught panic message (&str): Hello from std::panic -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic: 1 Caught panic message (String): Hello from std::panic: 1 -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic_any: 2 Caught panic message (String): Hello from std::panic_any: 2 -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Box<dyn Any> Failed to get caught panic message. -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic Caught panic message (&str): Hello from core::panic -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic: 5 Caught panic message (String): Hello from core::panic: 5 -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: index out of bounds: the len is 3 but the index is 4 Caught panic message (String): index out of bounds: the len is 3 but the index is 4 -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: attempt to divide by zero Caught panic message (&str): attempt to divide by zero -thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC: +thread 'main' ($TID) panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC: align_offset: align is not a power-of-two Caught panic message (&str): align_offset: align is not a power-of-two -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false -thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false Success! diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr index 4a3ac16debc..b388a3bedc0 100644 --- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr +++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr @@ -1,7 +1,7 @@ Thread 1 starting, will block on mutex Thread 1 reported it has started -thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: +thread '<unnamed>' ($TID) panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 2 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -9,7 +9,7 @@ Thread 2 blocking on thread 1 Thread 2 reported it has started Unlocking mutex -thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: +thread '<unnamed>' ($TID) panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 1 Thread 1 has exited Thread 2 has exited diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr index 8aff8f6ec55..7ae39204d4e 100644 --- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr +++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr @@ -1,9 +1,9 @@ -thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: once note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: +thread 'main' ($TID) panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: twice stack backtrace: diff --git a/src/tools/miri/tests/pass/panic/thread_panic.stderr b/src/tools/miri/tests/pass/panic/thread_panic.stderr index 3bb2991805c..92403d5152d 100644 --- a/src/tools/miri/tests/pass/panic/thread_panic.stderr +++ b/src/tools/miri/tests/pass/panic/thread_panic.stderr @@ -1,8 +1,8 @@ -thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC: +thread '<unnamed>' ($TID) panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC: +thread 'childthread' ($TID) panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello, world! diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 73fbe2cc020..f021d5194cd 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -248,7 +248,8 @@ regexes! { // erase alloc ids "alloc[0-9]+" => "ALLOC", // erase thread ids - r"unnamed-[0-9]+" => "unnamed-ID", + r"unnamed-[0-9]+" => "unnamed-ID", + r"thread '(?P<name>.*?)' \(\d+\) panicked" => "thread '$name' ($$TID) panicked", // erase borrow tags "<[0-9]+>" => "<TAG>", "<[0-9]+=" => "<TAG=", diff --git a/src/tools/run-make-support/src/diff/mod.rs b/src/tools/run-make-support/src/diff/mod.rs index ee48e373366..739eff72f05 100644 --- a/src/tools/run-make-support/src/diff/mod.rs +++ b/src/tools/run-make-support/src/diff/mod.rs @@ -23,6 +23,7 @@ pub struct Diff { actual: Option<String>, actual_name: Option<String>, normalizers: Vec<(String, String)>, + bless_dir: Option<String>, drop_bomb: DropBomb, } @@ -37,6 +38,7 @@ impl Diff { actual: None, actual_name: None, normalizers: Vec::new(), + bless_dir: std::env::var("RUSTC_BLESS_TEST").ok(), drop_bomb: DropBomb::arm("diff"), } } @@ -44,6 +46,13 @@ impl Diff { /// Specify the expected output for the diff from a file. pub fn expected_file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self { let path = path.as_ref(); + // In `--bless` mode, create the snapshot file if it doesn't already exist. + // The empty file will be overwritten with the actual text. + if self.bless_dir.is_some() + && let Ok(false) = std::fs::exists(path) + { + fs::write(path, ""); + } let content = fs::read_to_string(path); let name = path.to_string_lossy().to_string(); @@ -148,7 +157,7 @@ impl Diff { let Some(ref expected_file) = self.expected_file else { return false; }; - let Ok(bless_dir) = std::env::var("RUSTC_BLESS_TEST") else { + let Some(ref bless_dir) = self.bless_dir else { return false; }; diff --git a/src/tools/rustfmt/tests/rustfmt/main.rs b/src/tools/rustfmt/tests/rustfmt/main.rs index a9f58b9328e..4a9399377d1 100644 --- a/src/tools/rustfmt/tests/rustfmt/main.rs +++ b/src/tools/rustfmt/tests/rustfmt/main.rs @@ -185,10 +185,11 @@ fn dont_emit_ICE() { "tests/target/issue-6105.rs", ]; + let panic_re = regex::Regex::new("thread.*panicked").unwrap(); for file in files { let args = [file]; let (_stdout, stderr) = rustfmt(&args); - assert!(!stderr.contains("thread 'main' panicked")); + assert!(!panic_re.is_match(&stderr)); } } |
