@@ -644,7 +644,10 @@ pub fn debug_hygiene_data(verbose: bool) -> String {
644
644
let expn_data = expn_data. as_ref ( ) . expect ( "no expansion data for an expansion ID" ) ;
645
645
debug_expn_data ( ( & id. to_expn_id ( ) , expn_data) )
646
646
} ) ;
647
+
647
648
// Sort the hash map for more reproducible output.
649
+ // Because of this, it is fine to rely on the unstable iteration order of the map.
650
+ #[ allow( rustc:: potential_query_instability) ]
648
651
let mut foreign_expn_data: Vec < _ > = data. foreign_expn_data . iter ( ) . collect ( ) ;
649
652
foreign_expn_data. sort_by_key ( |( id, _) | ( id. krate , id. local_id ) ) ;
650
653
foreign_expn_data. into_iter ( ) . for_each ( debug_expn_data) ;
@@ -1210,6 +1213,7 @@ impl HygieneEncodeContext {
1210
1213
// It's fine to iterate over a HashMap, because the serialization
1211
1214
// of the table that we insert data into doesn't depend on insertion
1212
1215
// order
1216
+ #[ allow( rustc:: potential_query_instability) ]
1213
1217
for_all_ctxts_in ( latest_ctxts. into_iter ( ) , |index, ctxt, data| {
1214
1218
if self . serialized_ctxts . lock ( ) . insert ( ctxt) {
1215
1219
encode_ctxt ( encoder, index, data) ;
@@ -1218,6 +1222,8 @@ impl HygieneEncodeContext {
1218
1222
1219
1223
let latest_expns = { std:: mem:: take ( & mut * self . latest_expns . lock ( ) ) } ;
1220
1224
1225
+ // Same as above, this is fine as we are inserting into a order-independent hashset
1226
+ #[ allow( rustc:: potential_query_instability) ]
1221
1227
for_all_expns_in ( latest_expns. into_iter ( ) , |expn, data, hash| {
1222
1228
if self . serialized_expns . lock ( ) . insert ( expn) {
1223
1229
encode_expn ( encoder, expn, data, hash) ;
0 commit comments