@@ -644,7 +644,10 @@ pub fn debug_hygiene_data(verbose: bool) -> String {
644644 let expn_data = expn_data. as_ref ( ) . expect ( "no expansion data for an expansion ID" ) ;
645645 debug_expn_data ( ( & id. to_expn_id ( ) , expn_data) )
646646 } ) ;
647+
647648 // 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) ]
648651 let mut foreign_expn_data: Vec < _ > = data. foreign_expn_data . iter ( ) . collect ( ) ;
649652 foreign_expn_data. sort_by_key ( |( id, _) | ( id. krate , id. local_id ) ) ;
650653 foreign_expn_data. into_iter ( ) . for_each ( debug_expn_data) ;
@@ -1210,6 +1213,7 @@ impl HygieneEncodeContext {
12101213 // It's fine to iterate over a HashMap, because the serialization
12111214 // of the table that we insert data into doesn't depend on insertion
12121215 // order
1216+ #[ allow( rustc:: potential_query_instability) ]
12131217 for_all_ctxts_in ( latest_ctxts. into_iter ( ) , |index, ctxt, data| {
12141218 if self . serialized_ctxts . lock ( ) . insert ( ctxt) {
12151219 encode_ctxt ( encoder, index, data) ;
@@ -1218,6 +1222,8 @@ impl HygieneEncodeContext {
12181222
12191223 let latest_expns = { std:: mem:: take ( & mut * self . latest_expns . lock ( ) ) } ;
12201224
1225+ // Same as above, this is fine as we are inserting into a order-independent hashset
1226+ #[ allow( rustc:: potential_query_instability) ]
12211227 for_all_expns_in ( latest_expns. into_iter ( ) , |expn, data, hash| {
12221228 if self . serialized_expns . lock ( ) . insert ( expn) {
12231229 encode_expn ( encoder, expn, data, hash) ;
0 commit comments