1
Fork 0

Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives.

This commit is contained in:
Michael Woerister 2023-12-21 10:52:27 +01:00
parent 739e5ef49e
commit db132c575d
9 changed files with 40 additions and 33 deletions

View file

@ -1914,14 +1914,15 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
empty_proc_macro!(self);
let tcx = self.tcx;
let lib_features = tcx.lib_features(LOCAL_CRATE);
self.lazy_array(lib_features.to_vec())
self.lazy_array(lib_features.to_sorted_vec())
}
fn encode_stability_implications(&mut self) -> LazyArray<(Symbol, Symbol)> {
empty_proc_macro!(self);
let tcx = self.tcx;
let implications = tcx.stability_implications(LOCAL_CRATE);
self.lazy_array(implications.iter().map(|(k, v)| (*k, *v)))
let sorted = implications.to_sorted_stable_ord();
self.lazy_array(sorted.into_iter().map(|(k, v)| (*k, *v)))
}
fn encode_diagnostic_items(&mut self) -> LazyArray<(Symbol, DefIndex)> {