@@ -131,9 +131,9 @@ pub fn lints_that_can_emit(tcx: TyCtxt<'_>, (): ()) -> Lrc<(Vec<String>, Vec<Str
131
131
for group in lint_groups {
132
132
let binding = group. 0 . to_lowercase ( ) ;
133
133
let group_name = name_without_tool ( & binding) . to_string ( ) ;
134
- if visitor. lints_to_emit . contains ( & group_name) {
134
+ if visitor. lints_that_actually_run . contains ( & group_name) {
135
135
for lint in group. 1 {
136
- visitor. lints_to_emit . push ( name_without_tool ( & lint. to_string ( ) ) . to_string ( ) ) ;
136
+ visitor. lints_that_actually_run . push ( name_without_tool ( & lint. to_string ( ) ) . to_string ( ) ) ;
137
137
}
138
138
} else if visitor. lints_allowed . contains ( & group_name) {
139
139
for lint in & group. 1 {
@@ -142,7 +142,7 @@ pub fn lints_that_can_emit(tcx: TyCtxt<'_>, (): ()) -> Lrc<(Vec<String>, Vec<Str
142
142
}
143
143
}
144
144
145
- Lrc :: new ( ( visitor. lints_to_emit , visitor. lints_allowed ) )
145
+ Lrc :: new ( ( visitor. lints_that_actually_run , visitor. lints_allowed ) )
146
146
}
147
147
148
148
#[ instrument( level = "trace" , skip( tcx) , ret) ]
@@ -341,16 +341,16 @@ impl<'tcx> Visitor<'tcx> for LintLevelsBuilder<'_, LintLevelQueryMap<'tcx>> {
341
341
struct LintLevelMinimum < ' tcx > {
342
342
tcx : TyCtxt < ' tcx > ,
343
343
/// The actual list of detected lints.
344
- lints_to_emit : Vec < String > ,
345
- lints_allowed : Vec < String > ,
344
+ lints_that_actually_run : FxIndexSet < String > ,
345
+ lints_allowed : FxIndexSet < String > ,
346
346
}
347
347
348
348
impl < ' tcx > LintLevelMinimum < ' tcx > {
349
349
pub fn new ( tcx : TyCtxt < ' tcx > ) -> Self {
350
350
Self {
351
351
tcx,
352
352
// That magic number is the current number of lints + some more for possible future lints
353
- lints_to_emit : Vec :: with_capacity ( 230 ) ,
353
+ lints_that_actually_run : Vec :: with_capacity ( 230 ) ,
354
354
lints_allowed : Vec :: with_capacity ( 100 ) ,
355
355
}
356
356
}
@@ -360,7 +360,7 @@ impl<'tcx> LintLevelMinimum<'tcx> {
360
360
if * level == Level :: Allow {
361
361
self . lints_allowed . push ( lint. clone ( ) ) ;
362
362
} else {
363
- self . lints_to_emit . push ( lint. to_string ( ) ) ;
363
+ self . lints_that_actually_run . push ( lint. to_string ( ) ) ;
364
364
}
365
365
}
366
366
}
@@ -385,12 +385,12 @@ impl<'tcx> Visitor<'tcx> for LintLevelMinimum<'tcx> {
385
385
// If it's a tool lint (e.g. clippy::my_clippy_lint)
386
386
if let ast:: NestedMetaItem :: MetaItem ( meta_item) = meta_list {
387
387
if meta_item. path . segments . len ( ) == 1 {
388
- self . lints_to_emit . push (
388
+ self . lints_that_actually_run . push (
389
389
// SAFETY: Lint attributes can only have literals
390
390
meta_list. ident ( ) . unwrap ( ) . name . as_str ( ) . to_string ( ) ,
391
391
) ;
392
392
} else {
393
- self . lints_to_emit
393
+ self . lints_that_actually_run
394
394
. push ( meta_item. path . segments [ 1 ] . ident . name . as_str ( ) . to_string ( ) ) ;
395
395
}
396
396
}
0 commit comments