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