Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove allow(rustc::potential_query_instability) in rustc_span #99126

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compiler/rustc_span/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ pub fn debug_hygiene_data(verbose: bool) -> String {
let expn_data = expn_data.as_ref().expect("no expansion data for an expansion ID");
debug_expn_data((&id.to_expn_id(), expn_data))
});

// Sort the hash map for more reproducible output.
// Because of this, it is fine to rely on the unstable iteration order of the map.
#[allow(rustc::potential_query_instability)]
let mut foreign_expn_data: Vec<_> = data.foreign_expn_data.iter().collect();
foreign_expn_data.sort_by_key(|(id, _)| (id.krate, id.local_id));
foreign_expn_data.into_iter().for_each(debug_expn_data);
Expand Down Expand Up @@ -1210,6 +1213,7 @@ impl HygieneEncodeContext {
// It's fine to iterate over a HashMap, because the serialization
// of the table that we insert data into doesn't depend on insertion
// order
#[allow(rustc::potential_query_instability)]
for_all_ctxts_in(latest_ctxts.into_iter(), |index, ctxt, data| {
if self.serialized_ctxts.lock().insert(ctxt) {
encode_ctxt(encoder, index, data);
Expand All @@ -1218,6 +1222,8 @@ impl HygieneEncodeContext {

let latest_expns = { std::mem::take(&mut *self.latest_expns.lock()) };

// Same as above, this is fine as we are inserting into a order-independent hashset
#[allow(rustc::potential_query_instability)]
for_all_expns_in(latest_expns.into_iter(), |expn, data, hash| {
if self.serialized_expns.lock().insert(expn) {
encode_expn(encoder, expn, data, hash);
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#![feature(negative_impls)]
#![feature(min_specialization)]
#![feature(rustc_attrs)]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down