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