about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-11 09:04:28 +0000
committerbors <bors@rust-lang.org>2025-09-11 09:04:28 +0000
commit76c5ed2847cdb26ef2822a3a165d710f6b772217 (patch)
treee7eaf5da90738ef6953b28d81471a12d3a9296fc /compiler/rustc_span/src
parent5e33838ccad070f1536ed82336dd0133e2681233 (diff)
parent613a3b6a42b5c7413fe4a8ffd4f16ec39c32a814 (diff)
downloadrust-76c5ed2847cdb26ef2822a3a165d710f6b772217.tar.gz
rust-76c5ed2847cdb26ef2822a3a165d710f6b772217.zip
Auto merge of #146429 - Zalathar:rollup-eivhl6u, r=Zalathar
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#142315 (core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref)
 - rust-lang/rust#146335 (disable core dumps for panic-uninitialized-zeroed)
 - rust-lang/rust#146347 (report duplicate symbols added by the driver)
 - rust-lang/rust#146370 (Update the LoongArch target documentation)
 - rust-lang/rust#146379 (Fix `compare_against_sw_vers` test)
 - rust-lang/rust#146380 (Unify and deduplicate bits conv float tests)
 - rust-lang/rust#146415 (s390x: mark soft-float target feature as incompatible)
 - rust-lang/rust#146422 (Less greedily parse `[const]` bounds)
 - rust-lang/rust#146424 (Improve `core::ops` coverage)
 - rust-lang/rust#146425 (Improve `core::array` coverage)
 - rust-lang/rust#146428 (Revert `assert!` desugaring changes (rust-lang/rust#122661))

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/symbol.rs21
1 files changed, 15 insertions, 6 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index aedeb0e14ed..cdb0b5b58da 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -7,7 +7,7 @@ use std::ops::Deref;
 use std::{fmt, str};
 
 use rustc_arena::DroplessArena;
-use rustc_data_structures::fx::FxIndexSet;
+use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
 use rustc_data_structures::stable_hasher::{
     HashStable, StableCompare, StableHasher, ToStableHashKey,
 };
@@ -2871,11 +2871,20 @@ impl Interner {
         let byte_strs = FxIndexSet::from_iter(
             init.iter().copied().chain(extra.iter().copied()).map(|str| str.as_bytes()),
         );
-        assert_eq!(
-            byte_strs.len(),
-            init.len() + extra.len(),
-            "duplicate symbols in the rustc symbol list and the extra symbols added by the driver",
-        );
+
+        // The order in which duplicates are reported is irrelevant.
+        #[expect(rustc::potential_query_instability)]
+        if byte_strs.len() != init.len() + extra.len() {
+            panic!(
+                "duplicate symbols in the rustc symbol list and the extra symbols added by the driver: {:?}",
+                FxHashSet::intersection(
+                    &init.iter().copied().collect(),
+                    &extra.iter().copied().collect(),
+                )
+                .collect::<Vec<_>>()
+            )
+        }
+
         Interner(Lock::new(InternerInner { arena: Default::default(), byte_strs }))
     }