@@ -88,8 +88,6 @@ pub struct Analyzer<'analyzer, L: Language, Matcher, Break, Diag> {
88
88
suppression_action : Box < dyn SuppressionAction < Language = L > > ,
89
89
/// Handles analyzer signals emitted by individual rules
90
90
emit_signal : SignalHandler < ' analyzer , L , Break > ,
91
- /// The rule categories used during the run of the analyzer
92
- categories : RuleCategories ,
93
91
}
94
92
95
93
pub struct AnalyzerContext < ' a , L : Language > {
@@ -113,7 +111,6 @@ where
113
111
parse_suppression_comment : SuppressionParser < Diag > ,
114
112
suppression_action : Box < dyn SuppressionAction < Language = L > > ,
115
113
emit_signal : SignalHandler < ' analyzer , L , Break > ,
116
- categories : RuleCategories ,
117
114
) -> Self {
118
115
Self {
119
116
phases : BTreeMap :: new ( ) ,
@@ -123,7 +120,6 @@ where
123
120
parse_suppression_comment,
124
121
suppression_action,
125
122
emit_signal,
126
- categories,
127
123
}
128
124
}
129
125
@@ -150,7 +146,6 @@ where
150
146
mut emit_signal,
151
147
suppression_action,
152
148
metadata : _,
153
- categories,
154
149
} = self ;
155
150
156
151
let mut line_index = 0 ;
@@ -171,7 +166,6 @@ where
171
166
suppression_action : suppression_action. as_ref ( ) ,
172
167
options : ctx. options ,
173
168
suppressions : & mut suppressions,
174
- categories,
175
169
deny_top_level_suppressions : false ,
176
170
} ;
177
171
@@ -329,8 +323,6 @@ struct PhaseRunner<'analyzer, 'phase, L: Language, Matcher, Break, Diag> {
329
323
options : & ' phase AnalyzerOptions ,
330
324
/// Tracks all suppressions during the analyzer phase
331
325
suppressions : & ' phase mut Suppressions < ' analyzer > ,
332
- /// The current categories
333
- categories : RuleCategories ,
334
326
/// Whether we have already encountered a token that can't precede top level suppressions
335
327
deny_top_level_suppressions : bool ,
336
328
}
@@ -573,18 +565,6 @@ where
573
565
( self . emit_signal ) ( & signal) ?;
574
566
}
575
567
576
- if !self . categories . contains ( suppression. category ) {
577
- let signal = DiagnosticSignal :: new ( || {
578
- AnalyzerSuppressionDiagnostic :: new (
579
- category ! ( "suppressions/unused" ) ,
580
- suppression. ignore_range . unwrap_or ( range) ,
581
- "Suppression comment has no effect because the tool is not enabled." ,
582
- )
583
- } ) ;
584
- ( self . emit_signal ) ( & signal) ?;
585
- continue ;
586
- }
587
-
588
568
if let Err ( diagnostic) = self . suppressions . push_suppression (
589
569
& suppression,
590
570
range,
0 commit comments