@@ -7,7 +7,7 @@ use std::ops::Deref;
7
7
use std:: { fmt, str} ;
8
8
9
9
use rustc_arena:: DroplessArena ;
10
- use rustc_data_structures:: fx:: FxIndexSet ;
10
+ use rustc_data_structures:: fx:: { FxHashSet , FxIndexSet } ;
11
11
use rustc_data_structures:: stable_hasher:: {
12
12
HashStable , StableCompare , StableHasher , ToStableHashKey ,
13
13
} ;
@@ -2867,11 +2867,20 @@ impl Interner {
2867
2867
let byte_strs = FxIndexSet :: from_iter (
2868
2868
init. iter ( ) . copied ( ) . chain ( extra. iter ( ) . copied ( ) ) . map ( |str| str. as_bytes ( ) ) ,
2869
2869
) ;
2870
- assert_eq ! (
2871
- byte_strs. len( ) ,
2872
- init. len( ) + extra. len( ) ,
2873
- "duplicate symbols in the rustc symbol list and the extra symbols added by the driver" ,
2874
- ) ;
2870
+
2871
+ // The order in which duplicates are reported is irrelevant.
2872
+ #[ expect( rustc:: potential_query_instability) ]
2873
+ if byte_strs. len ( ) != init. len ( ) + extra. len ( ) {
2874
+ panic ! (
2875
+ "duplicate symbols in the rustc symbol list and the extra symbols added by the driver: {:?}" ,
2876
+ FxHashSet :: intersection(
2877
+ & init. iter( ) . copied( ) . collect( ) ,
2878
+ & extra. iter( ) . copied( ) . collect( ) ,
2879
+ )
2880
+ . collect:: <Vec <_>>( )
2881
+ )
2882
+ }
2883
+
2875
2884
Interner ( Lock :: new ( InternerInner { arena : Default :: default ( ) , byte_strs } ) )
2876
2885
}
2877
2886
0 commit comments