1
Fork 0

Auto merge of #90842 - pierwill:localdefid-indexmap, r=wesleywiser

Use `indexmap` to avoid sorting `LocalDefId`s

See discussion in https://github.com/rust-lang/rust/pull/90408#discussion_r745935459.

Related to work on https://github.com/rust-lang/rust/issues/90317.
This commit is contained in:
bors 2022-01-24 22:04:55 +00:00
commit e7825f2b69
9 changed files with 30 additions and 31 deletions

View file

@ -1314,7 +1314,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
return;
}
let mut keys_and_jobs = self
let keys_and_jobs = self
.tcx
.mir_keys(())
.iter()
@ -1327,8 +1327,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
}
})
.collect::<Vec<_>>();
// Sort everything to ensure a stable order for diagnotics.
keys_and_jobs.sort_by_key(|&(def_id, _, _)| def_id.index());
for (def_id, encode_const, encode_opt) in keys_and_jobs.into_iter() {
debug_assert!(encode_const || encode_opt);