From 22384f46e1f7e736c789c05d2259e786fc000794 Mon Sep 17 00:00:00 2001 From: xmakro Date: Mon, 1 Jun 2026 21:31:51 -0700 Subject: [PATCH 1/3] Use a per-thread error count for post-monomorphization error notes `collect_items_rec` snapshots the error count before processing a mono item and compares it afterwards to decide whether to attach the "the above error was encountered while instantiating ..." note. The mono item graph is walked in parallel, so the global error count can be bumped by an error emitted while collecting a different item on another thread between the two reads, which makes an unrelated item (often lang_start) get blamed. Add `DiagCtxt::err_count_on_current_thread`, backed by a thread-local counter bumped next to the shared error count, and use it for the snapshot and comparison. It is not affected by errors emitted on other threads. In serial compilation it is equivalent to a delta of `err_count`. --- compiler/rustc_errors/src/lib.rs | 32 ++++++++++++++++++++ compiler/rustc_monomorphize/src/collector.rs | 10 ++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 55f10867c9321..776bb1a1dde65 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -461,6 +461,19 @@ impl Drop for DiagCtxtInner { } } +thread_local! { + /// Number of errors emitted on the current thread. + /// + /// The shared error count ([`DiagCtxt::err_count`]) is bumped by every + /// thread, so a before/after delta taken around one unit of work can be + /// polluted by errors emitted concurrently on other threads. The + /// monomorphization collector relies on such a delta to attribute + /// post-monomorphization errors to the right item, and got confused when + /// collecting in parallel (see #154260). This per-thread count lets it take + /// a delta that is not affected by other threads. + static THREAD_ERR_COUNT: Cell = const { Cell::new(0) }; +} + impl DiagCtxt { pub fn disable_warnings(mut self) -> Self { self.inner.get_mut().flags.can_emit_warnings = false; @@ -714,6 +727,19 @@ impl<'a> DiagCtxtHandle<'a> { .sum::() } + /// The number of errors that have been emitted on the *current thread*. + /// + /// Unlike [`DiagCtxt::err_count`], which counts errors emitted by all + /// threads, this only counts errors emitted by the calling thread. It is + /// meant for code that takes a before/after delta to detect whether a unit + /// of work emitted an error, and must not be misled by errors emitted on + /// other threads at the same time (#154260). In serial compilation it is + /// equivalent to taking a delta of `err_count`. + #[inline] + pub fn err_count_on_current_thread(&self) -> usize { + THREAD_ERR_COUNT.with(Cell::get) + } + /// This excludes lint errors and delayed bugs. Unless absolutely /// necessary, prefer `has_errors` to this method. pub fn has_errors_excluding_lint_errors(&self) -> Option { @@ -1333,6 +1359,12 @@ impl DiagCtxtInner { } if is_error { + // Mirror the bump of the shared error count (`err_guars` / + // `lint_err_guars` below) on a per-thread counter, so a single + // thread can tell whether *it* emitted an error without being + // affected by other threads (see `err_count_on_current_thread`). + THREAD_ERR_COUNT.with(|c| c.set(c.get() + 1)); + // If we have any delayed bugs recorded, we can discard them // because they won't be used. (This should only occur if there // have been no errors previously emitted, because we don't add diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 9ddd33678c341..d1514fbf4fca3 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -412,8 +412,14 @@ fn collect_items_rec<'tcx>( // error count. If it has changed, a PME occurred, and we trigger some diagnostics about the // current step of mono items collection. // + // We use the per-thread error count rather than the global one: the mono item graph is walked + // in parallel (see the `par_for_each_in` in `collect_crate_mono_items`), so the global count + // can be bumped by an unrelated error emitted on another thread between the two reads, which + // would then wrongly blame this item (#154260). The per-thread count is not affected by errors + // emitted on other threads, so the delta reflects work done on this thread. + // // FIXME: don't rely on global state, instead bubble up errors. Note: this is very hard to do. - let error_count = tcx.dcx().err_count(); + let error_count = tcx.dcx().err_count_on_current_thread(); // In `mentioned_items` we collect items that were mentioned in this MIR but possibly do not // need to be monomorphized. This is done to ensure that optimizing away function calls does not @@ -538,7 +544,7 @@ fn collect_items_rec<'tcx>( // Check for PMEs and emit a diagnostic if one happened. To try to show relevant edges of the // mono item graph. - if tcx.dcx().err_count() > error_count + if tcx.dcx().err_count_on_current_thread() > error_count && starting_item.node.is_generic_fn() && starting_item.node.is_user_defined() { From c9c1d536149e2a1ceb73eb49da84967cad8bc49e Mon Sep 17 00:00:00 2001 From: xmakro Date: Wed, 3 Jun 2026 08:47:59 -0700 Subject: [PATCH 2/3] Re-enable parallel frontend tests for post-monomorphization errors These were marked ignore-parallel-frontend because the spurious instantiation note made their output nondeterministic under -Zthreads. With that fixed they pass reliably. Replace the directive with a blank line rather than deleting it, so the following line numbers stay the same and the expected output is unchanged. --- tests/ui/abi/simd-abi-checks-avx.rs | 2 +- tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs | 2 +- tests/ui/consts/const-eval/issue-50814-2.rs | 2 +- tests/ui/consts/const-eval/issue-50814.rs | 2 +- tests/ui/consts/mono-reachable-invalid-const.rs | 2 +- tests/ui/consts/required-consts/collect-in-called-fn.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-closure.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-drop.rs | 2 +- .../required-consts/collect-in-dead-fn-behind-assoc-type.rs | 2 +- .../consts/required-consts/collect-in-dead-fn-behind-generic.rs | 2 +- .../required-consts/collect-in-dead-fn-behind-opaque-type.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-fn.rs | 2 +- .../ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-fnptr.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-forget.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-move.rs | 2 +- tests/ui/consts/required-consts/collect-in-dead-vtable.rs | 2 +- tests/ui/consts/required-consts/collect-in-promoted-const.rs | 2 +- tests/ui/consts/required-consts/interpret-in-const-called-fn.rs | 2 +- tests/ui/consts/required-consts/interpret-in-promoted.rs | 2 +- tests/ui/consts/required-consts/interpret-in-static.rs | 2 +- tests/ui/inline-const/required-const.rs | 2 +- tests/ui/lint/large_assignments/copy_into_box_rc_arc.rs | 2 +- tests/ui/lint/large_assignments/copy_into_fn.rs | 2 +- tests/ui/lint/large_assignments/inline_mir.rs | 2 +- tests/ui/lint/large_assignments/large_future.rs | 2 +- tests/ui/lint/large_assignments/move_into_fn.rs | 2 +- tests/ui/simd/const-err-trumps-simd-err.rs | 2 +- tests/ui/structs/default-field-values/post-mono.rs | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/ui/abi/simd-abi-checks-avx.rs b/tests/ui/abi/simd-abi-checks-avx.rs index c68ba2fb5f890..7432381d15b72 100644 --- a/tests/ui/abi/simd-abi-checks-avx.rs +++ b/tests/ui/abi/simd-abi-checks-avx.rs @@ -1,7 +1,7 @@ //@ only-x86_64 //@ build-fail //@ compile-flags: -C target-feature=-avx -//@ ignore-parallel-frontend post-monomorphization errors + #![feature(portable_simd)] #![feature(simd_ffi)] #![allow(improper_ctypes_definitions)] diff --git a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs index dbe507e3cd137..6777bee050a16 100644 --- a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs +++ b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ ignore-parallel-frontend post-monomorphization errors + // Regression test for #66975 #![warn(unconditional_panic)] #![feature(never_type)] diff --git a/tests/ui/consts/const-eval/issue-50814-2.rs b/tests/ui/consts/const-eval/issue-50814-2.rs index 34a200e2887b9..1b917a0916da3 100644 --- a/tests/ui/consts/const-eval/issue-50814-2.rs +++ b/tests/ui/consts/const-eval/issue-50814-2.rs @@ -2,7 +2,7 @@ //@ revisions: normal mir-opt //@ [mir-opt]compile-flags: -Zmir-opt-level=4 //@ dont-require-annotations: NOTE -//@ ignore-parallel-frontend post-monomorphization errors + trait C { const BOO: usize; } diff --git a/tests/ui/consts/const-eval/issue-50814.rs b/tests/ui/consts/const-eval/issue-50814.rs index 3901a2c0c9316..011f065ad814b 100644 --- a/tests/ui/consts/const-eval/issue-50814.rs +++ b/tests/ui/consts/const-eval/issue-50814.rs @@ -1,6 +1,6 @@ //@ build-fail //@ dont-require-annotations: NOTE -//@ ignore-parallel-frontend post-monomorphization errors + trait Unsigned { const MAX: u8; } diff --git a/tests/ui/consts/mono-reachable-invalid-const.rs b/tests/ui/consts/mono-reachable-invalid-const.rs index 3d76e4a65a4e2..aba41dabe71f9 100644 --- a/tests/ui/consts/mono-reachable-invalid-const.rs +++ b/tests/ui/consts/mono-reachable-invalid-const.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ ignore-parallel-frontend post-monomorphization errors + struct Bar; impl Bar { diff --git a/tests/ui/consts/required-consts/collect-in-called-fn.rs b/tests/ui/consts/required-consts/collect-in-called-fn.rs index d07c0927a16a9..2045b8266c792 100644 --- a/tests/ui/consts/required-consts/collect-in-called-fn.rs +++ b/tests/ui/consts/required-consts/collect-in-called-fn.rs @@ -4,7 +4,7 @@ //@[opt] compile-flags: -O //! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is //! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-closure.rs b/tests/ui/consts/required-consts/collect-in-dead-closure.rs index 825336e9d3ef3..5f8b6bbb174c4 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-closure.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-closure.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-drop.rs b/tests/ui/consts/required-consts/collect-in-dead-drop.rs index fa9b8730c11c9..f7293d162df7b 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-drop.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-drop.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs index a76481b673132..e6be9f56cb7a0 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs @@ -4,7 +4,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs index 4fe05db34d78e..a86902af52677 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs index a6132ef1fe07e..4cdb27413540f 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs @@ -4,7 +4,7 @@ //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. #![feature(type_alias_impl_trait)] -//@ ignore-parallel-frontend post-monomorphization errors + mod m { struct Fail(T); impl Fail { diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn.rs b/tests/ui/consts/required-consts/collect-in-dead-fn.rs index f4627323249d4..0c4795801068d 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fn.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs index 8808a4e26f0cb..04544cb413984 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Late(T); impl Late { const FAIL: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs b/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs index 1a9b99f9868f6..4cdb50f4385a1 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-forget.rs b/tests/ui/consts/required-consts/collect-in-dead-forget.rs index bc717edbe73ee..7586004116c36 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-forget.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-forget.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This passes without optimizations, so it can (and should) also pass with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); diff --git a/tests/ui/consts/required-consts/collect-in-dead-move.rs b/tests/ui/consts/required-consts/collect-in-dead-move.rs index 05491136e8d5e..4e2d959db32c7 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-move.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-move.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs index 1ca52064a3fdd..d4ad730837730 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! This fails without optimizations, so it should also fail with optimizations. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/collect-in-promoted-const.rs b/tests/ui/consts/required-consts/collect-in-promoted-const.rs index 415f22fd05dda..c475720938697 100644 --- a/tests/ui/consts/required-consts/collect-in-promoted-const.rs +++ b/tests/ui/consts/required-consts/collect-in-promoted-const.rs @@ -3,7 +3,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they get promoted. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR evaluation panicked: explicit panic diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs index 2d63c620a0384..9309457e22a46 100644 --- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs +++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs @@ -2,7 +2,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they are unused. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR explicit panic diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.rs b/tests/ui/consts/required-consts/interpret-in-promoted.rs index cbb1a309006c5..b223e6d16aa12 100644 --- a/tests/ui/consts/required-consts/interpret-in-promoted.rs +++ b/tests/ui/consts/required-consts/interpret-in-promoted.rs @@ -2,7 +2,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //@ dont-require-annotations: NOTE -//@ ignore-parallel-frontend post-monomorphization errors + //! Make sure we evaluate const fn calls even if they get promoted and their result ignored. const unsafe fn ub() { diff --git a/tests/ui/consts/required-consts/interpret-in-static.rs b/tests/ui/consts/required-consts/interpret-in-static.rs index edc7b1d01fd6c..19ad6be1c9fa7 100644 --- a/tests/ui/consts/required-consts/interpret-in-static.rs +++ b/tests/ui/consts/required-consts/interpret-in-static.rs @@ -2,7 +2,7 @@ //@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they are unused. -//@ ignore-parallel-frontend post-monomorphization errors + struct Fail(T); impl Fail { const C: () = panic!(); //~ERROR explicit panic diff --git a/tests/ui/inline-const/required-const.rs b/tests/ui/inline-const/required-const.rs index 437652532ec54..8f640e933d019 100644 --- a/tests/ui/inline-const/required-const.rs +++ b/tests/ui/inline-const/required-const.rs @@ -1,6 +1,6 @@ //@ build-fail //@ compile-flags: -Zmir-opt-level=3 -//@ ignore-parallel-frontend post-monomorphization errors + fn foo() { if false { const { panic!() } //~ ERROR E0080 diff --git a/tests/ui/lint/large_assignments/copy_into_box_rc_arc.rs b/tests/ui/lint/large_assignments/copy_into_box_rc_arc.rs index a8e23c0246eeb..dfa0b8015d037 100644 --- a/tests/ui/lint/large_assignments/copy_into_box_rc_arc.rs +++ b/tests/ui/lint/large_assignments/copy_into_box_rc_arc.rs @@ -3,7 +3,7 @@ #![move_size_limit = "1000"] //@ build-fail //@ only-64bit -//@ ignore-parallel-frontend post-monomorphization errors + //@ edition:2018 //@ compile-flags: -Zmir-opt-level=1 diff --git a/tests/ui/lint/large_assignments/copy_into_fn.rs b/tests/ui/lint/large_assignments/copy_into_fn.rs index 8f8e7f0822bbc..5222e833bcc8f 100644 --- a/tests/ui/lint/large_assignments/copy_into_fn.rs +++ b/tests/ui/lint/large_assignments/copy_into_fn.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ ignore-parallel-frontend post-monomorphization errors + #![feature(large_assignments)] #![move_size_limit = "1000"] #![deny(large_assignments)] diff --git a/tests/ui/lint/large_assignments/inline_mir.rs b/tests/ui/lint/large_assignments/inline_mir.rs index 68c5de4902f34..d16aae6ab145b 100644 --- a/tests/ui/lint/large_assignments/inline_mir.rs +++ b/tests/ui/lint/large_assignments/inline_mir.rs @@ -13,7 +13,7 @@ //! ``` //! //! We want the diagnostics to point to the relevant user code. -//@ ignore-parallel-frontend post-monomorphization errors + //@ build-fail //@ compile-flags: -Zmir-opt-level=1 -Zinline-mir diff --git a/tests/ui/lint/large_assignments/large_future.rs b/tests/ui/lint/large_assignments/large_future.rs index 1be66f16313bb..28c358bdbf086 100644 --- a/tests/ui/lint/large_assignments/large_future.rs +++ b/tests/ui/lint/large_assignments/large_future.rs @@ -5,7 +5,7 @@ //@ only-64bit //@ revisions: attribute option //@ [option]compile-flags: -Zmove-size-limit=1000 -//@ ignore-parallel-frontend post-monomorphization errors + //@ edition:2018 //@ compile-flags: -Zmir-opt-level=0 diff --git a/tests/ui/lint/large_assignments/move_into_fn.rs b/tests/ui/lint/large_assignments/move_into_fn.rs index 1e793a082e3ea..b3b2160ca36e1 100644 --- a/tests/ui/lint/large_assignments/move_into_fn.rs +++ b/tests/ui/lint/large_assignments/move_into_fn.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ ignore-parallel-frontend post-monomorphization errors + #![feature(large_assignments)] #![move_size_limit = "1000"] #![deny(large_assignments)] diff --git a/tests/ui/simd/const-err-trumps-simd-err.rs b/tests/ui/simd/const-err-trumps-simd-err.rs index 282d5dabf72fa..33f0abb06f3ea 100644 --- a/tests/ui/simd/const-err-trumps-simd-err.rs +++ b/tests/ui/simd/const-err-trumps-simd-err.rs @@ -1,6 +1,6 @@ //@build-fail //@ dont-require-annotations: NOTE -//@ ignore-parallel-frontend post-monomorphization errors + //! Make sure that monomorphization-time const errors from `static_assert` take priority over the //! error from simd_extract. Basically this checks that if a const fails to evaluate in some //! function, we don't bother codegen'ing the function. diff --git a/tests/ui/structs/default-field-values/post-mono.rs b/tests/ui/structs/default-field-values/post-mono.rs index 57092083ca102..68dfa391bb485 100644 --- a/tests/ui/structs/default-field-values/post-mono.rs +++ b/tests/ui/structs/default-field-values/post-mono.rs @@ -1,6 +1,6 @@ //@ build-fail //@ revisions: direct indirect -//@ ignore-parallel-frontend post-monomorphization errors + #![feature(default_field_values)] struct Z { From 8649755fecfe0f836933984ed34054f57d6b59e4 Mon Sep 17 00:00:00 2001 From: xmakro Date: Tue, 2 Jun 2026 12:28:53 -0700 Subject: [PATCH 3/3] Fix broken intra-doc link to `DiagCtxtHandle::err_count` --- compiler/rustc_errors/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 776bb1a1dde65..f6b4293458970 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -729,7 +729,7 @@ impl<'a> DiagCtxtHandle<'a> { /// The number of errors that have been emitted on the *current thread*. /// - /// Unlike [`DiagCtxt::err_count`], which counts errors emitted by all + /// Unlike [`DiagCtxtHandle::err_count`], which counts errors emitted by all /// threads, this only counts errors emitted by the calling thread. It is /// meant for code that takes a before/after delta to detect whether a unit /// of work emitted an error, and must not be misled by errors emitted on