@@ -18,8 +18,9 @@ use self::TargetLint::*;
18
18
19
19
use crate :: levels:: LintLevelsBuilder ;
20
20
use crate :: passes:: { EarlyLintPassObject , LateLintPassObject } ;
21
- use rustc_data_structures:: fx:: FxHashMap ;
21
+ use rustc_data_structures:: fx:: FxIndexMap ;
22
22
use rustc_data_structures:: sync;
23
+ use rustc_data_structures:: unord:: UnordMap ;
23
24
use rustc_errors:: { DecorateLint , DiagnosticBuilder , DiagnosticMessage , MultiSpan } ;
24
25
use rustc_feature:: Features ;
25
26
use rustc_hir as hir;
@@ -69,10 +70,10 @@ pub struct LintStore {
69
70
pub late_module_passes : Vec < Box < LateLintPassFactory > > ,
70
71
71
72
/// Lints indexed by name.
72
- by_name : FxHashMap < String , TargetLint > ,
73
+ by_name : UnordMap < String , TargetLint > ,
73
74
74
75
/// Map of registered lint groups to what lints they expand to.
75
- lint_groups : FxHashMap < & ' static str , LintGroup > ,
76
+ lint_groups : FxIndexMap < & ' static str , LintGroup > ,
76
77
}
77
78
78
79
impl LintStoreMarker for LintStore { }
@@ -326,9 +327,11 @@ impl LintStore {
326
327
327
328
/// True if this symbol represents a lint group name.
328
329
pub fn is_lint_group ( & self , lint_name : Symbol ) -> bool {
329
- #[ allow( rustc:: potential_query_instability) ]
330
- let lint_groups = self . lint_groups . keys ( ) . collect :: < Vec < _ > > ( ) ;
331
- debug ! ( "is_lint_group(lint_name={:?}, lint_groups={:?})" , lint_name, lint_groups) ;
330
+ debug ! (
331
+ "is_lint_group(lint_name={:?}, lint_groups={:?})" ,
332
+ lint_name,
333
+ self . lint_groups. keys( ) . collect:: <Vec <_>>( )
334
+ ) ;
332
335
let lint_name_str = lint_name. as_str ( ) ;
333
336
self . lint_groups . contains_key ( lint_name_str) || {
334
337
let warnings_name_str = crate :: WARNINGS . name_lower ( ) ;
@@ -372,12 +375,9 @@ impl LintStore {
372
375
None => {
373
376
// 1. The tool is currently running, so this lint really doesn't exist.
374
377
// FIXME: should this handle tools that never register a lint, like rustfmt?
375
- #[ allow( rustc:: potential_query_instability) ]
376
- let lints = self . by_name . keys ( ) . collect :: < Vec < _ > > ( ) ;
377
- debug ! ( "lints={:?}" , lints) ;
378
+ debug ! ( "lints={:?}" , self . by_name. keys( ) . into_sorted_stable_ord( ) ) ;
378
379
let tool_prefix = format ! ( "{tool_name}::" ) ;
379
380
380
- #[ allow( rustc:: potential_query_instability) ]
381
381
return if self . by_name . keys ( ) . any ( |lint| lint. starts_with ( & tool_prefix) ) {
382
382
self . no_lint_suggestion ( & complete_name, tool_name. as_str ( ) )
383
383
} else {
0 commit comments