@@ -15,7 +15,7 @@ use crate::{
1515} ;
1616use rustc_ast as ast;
1717use rustc_ast_pretty:: pprust;
18- use rustc_data_structures:: fx:: FxHashMap ;
18+ use rustc_data_structures:: fx:: FxIndexMap ;
1919use rustc_errors:: { DecorateLint , DiagnosticBuilder , DiagnosticMessage , MultiSpan } ;
2020use rustc_feature:: { Features , GateIssue } ;
2121use rustc_hir as hir;
@@ -73,7 +73,7 @@ rustc_index::newtype_index! {
7373struct LintSet {
7474 // -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
7575 // flag.
76- specs : FxHashMap < LintId , LevelAndSource > ,
76+ specs : FxIndexMap < LintId , LevelAndSource > ,
7777 parent : LintStackIndex ,
7878}
7979
@@ -86,7 +86,7 @@ impl LintLevelSets {
8686 & self ,
8787 lint : & ' static Lint ,
8888 idx : LintStackIndex ,
89- aux : Option < & FxHashMap < LintId , LevelAndSource > > ,
89+ aux : Option < & FxIndexMap < LintId , LevelAndSource > > ,
9090 sess : & Session ,
9191 ) -> LevelAndSource {
9292 let lint = LintId :: of ( lint) ;
@@ -101,7 +101,7 @@ impl LintLevelSets {
101101 & self ,
102102 id : LintId ,
103103 mut idx : LintStackIndex ,
104- aux : Option < & FxHashMap < LintId , LevelAndSource > > ,
104+ aux : Option < & FxIndexMap < LintId , LevelAndSource > > ,
105105 ) -> ( Option < Level > , LintLevelSource ) {
106106 if let Some ( specs) = aux {
107107 if let Some ( & ( level, src) ) = specs. get ( & id) {
@@ -132,8 +132,8 @@ fn lint_expectations(tcx: TyCtxt<'_>, (): ()) -> Vec<(LintExpectationId, LintExp
132132 cur : hir:: CRATE_HIR_ID ,
133133 specs : ShallowLintLevelMap :: default ( ) ,
134134 expectations : Vec :: new ( ) ,
135- unstable_to_stable_ids : FxHashMap :: default ( ) ,
136- empty : FxHashMap :: default ( ) ,
135+ unstable_to_stable_ids : FxIndexMap :: default ( ) ,
136+ empty : FxIndexMap :: default ( ) ,
137137 } ,
138138 lint_added_lints : false ,
139139 store,
@@ -161,7 +161,7 @@ fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLe
161161 tcx,
162162 cur : owner. into ( ) ,
163163 specs : ShallowLintLevelMap :: default ( ) ,
164- empty : FxHashMap :: default ( ) ,
164+ empty : FxIndexMap :: default ( ) ,
165165 attrs,
166166 } ,
167167 lint_added_lints : false ,
@@ -209,14 +209,14 @@ pub struct TopDown {
209209}
210210
211211pub trait LintLevelsProvider {
212- fn current_specs ( & self ) -> & FxHashMap < LintId , LevelAndSource > ;
212+ fn current_specs ( & self ) -> & FxIndexMap < LintId , LevelAndSource > ;
213213 fn insert ( & mut self , id : LintId , lvl : LevelAndSource ) ;
214214 fn get_lint_level ( & self , lint : & ' static Lint , sess : & Session ) -> LevelAndSource ;
215215 fn push_expectation ( & mut self , _id : LintExpectationId , _expectation : LintExpectation ) { }
216216}
217217
218218impl LintLevelsProvider for TopDown {
219- fn current_specs ( & self ) -> & FxHashMap < LintId , LevelAndSource > {
219+ fn current_specs ( & self ) -> & FxIndexMap < LintId , LevelAndSource > {
220220 & self . sets . list [ self . cur ] . specs
221221 }
222222
@@ -234,12 +234,12 @@ struct LintLevelQueryMap<'tcx> {
234234 cur : HirId ,
235235 specs : ShallowLintLevelMap ,
236236 /// Empty hash map to simplify code.
237- empty : FxHashMap < LintId , LevelAndSource > ,
237+ empty : FxIndexMap < LintId , LevelAndSource > ,
238238 attrs : & ' tcx hir:: AttributeMap < ' tcx > ,
239239}
240240
241241impl LintLevelsProvider for LintLevelQueryMap < ' _ > {
242- fn current_specs ( & self ) -> & FxHashMap < LintId , LevelAndSource > {
242+ fn current_specs ( & self ) -> & FxIndexMap < LintId , LevelAndSource > {
243243 self . specs . specs . get ( & self . cur . local_id ) . unwrap_or ( & self . empty )
244244 }
245245 fn insert ( & mut self , id : LintId , lvl : LevelAndSource ) {
@@ -257,13 +257,13 @@ struct QueryMapExpectationsWrapper<'tcx> {
257257 /// Level map for `cur`.
258258 specs : ShallowLintLevelMap ,
259259 expectations : Vec < ( LintExpectationId , LintExpectation ) > ,
260- unstable_to_stable_ids : FxHashMap < LintExpectationId , LintExpectationId > ,
260+ unstable_to_stable_ids : FxIndexMap < LintExpectationId , LintExpectationId > ,
261261 /// Empty hash map to simplify code.
262- empty : FxHashMap < LintId , LevelAndSource > ,
262+ empty : FxIndexMap < LintId , LevelAndSource > ,
263263}
264264
265265impl LintLevelsProvider for QueryMapExpectationsWrapper < ' _ > {
266- fn current_specs ( & self ) -> & FxHashMap < LintId , LevelAndSource > {
266+ fn current_specs ( & self ) -> & FxIndexMap < LintId , LevelAndSource > {
267267 self . specs . specs . get ( & self . cur . local_id ) . unwrap_or ( & self . empty )
268268 }
269269 fn insert ( & mut self , id : LintId , lvl : LevelAndSource ) {
@@ -486,7 +486,7 @@ impl<'s> LintLevelsBuilder<'s, TopDown> {
486486 . provider
487487 . sets
488488 . list
489- . push ( LintSet { specs : FxHashMap :: default ( ) , parent : COMMAND_LINE } ) ;
489+ . push ( LintSet { specs : FxIndexMap :: default ( ) , parent : COMMAND_LINE } ) ;
490490 self . add_command_line ( ) ;
491491 }
492492
@@ -512,7 +512,7 @@ impl<'s> LintLevelsBuilder<'s, TopDown> {
512512 ) -> BuilderPush {
513513 let prev = self . provider . cur ;
514514 self . provider . cur =
515- self . provider . sets . list . push ( LintSet { specs : FxHashMap :: default ( ) , parent : prev } ) ;
515+ self . provider . sets . list . push ( LintSet { specs : FxIndexMap :: default ( ) , parent : prev } ) ;
516516
517517 self . add ( attrs, is_crate_node, source_hir_id) ;
518518
@@ -547,7 +547,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
547547 self . features
548548 }
549549
550- fn current_specs ( & self ) -> & FxHashMap < LintId , LevelAndSource > {
550+ fn current_specs ( & self ) -> & FxIndexMap < LintId , LevelAndSource > {
551551 self . provider . current_specs ( )
552552 }
553553
0 commit comments