@@ -66,17 +66,12 @@ rustc_index::newtype_index! {
6666}
6767
6868#[ derive( Debug , HashStable ) ]
69- pub enum LintSet {
70- CommandLine {
71- // -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
72- // flag.
73- specs : FxHashMap < LintId , LevelAndSource > ,
74- } ,
75-
76- Node {
77- specs : FxHashMap < LintId , LevelAndSource > ,
78- parent : LintStackIndex ,
79- } ,
69+ pub struct LintSet {
70+ // -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
71+ // flag.
72+ pub specs : FxHashMap < LintId , LevelAndSource > ,
73+
74+ pub parent : LintStackIndex ,
8075}
8176
8277impl LintLevelSets {
@@ -139,20 +134,14 @@ impl LintLevelSets {
139134 }
140135 }
141136 loop {
142- match self . list [ idx] {
143- LintSet :: CommandLine { ref specs } => {
144- if let Some ( & ( level, src) ) = specs. get ( & id) {
145- return ( Some ( level) , src) ;
146- }
147- return ( None , LintLevelSource :: Default ) ;
148- }
149- LintSet :: Node { ref specs, parent } => {
150- if let Some ( & ( level, src) ) = specs. get ( & id) {
151- return ( Some ( level) , src) ;
152- }
153- idx = parent;
154- }
137+ let LintSet { ref specs, parent } = self . list [ idx] ;
138+ if let Some ( & ( level, src) ) = specs. get ( & id) {
139+ return ( Some ( level) , src) ;
140+ }
141+ if idx == COMMAND_LINE {
142+ return ( None , LintLevelSource :: Default ) ;
155143 }
144+ idx = parent;
156145 }
157146 }
158147}
0 commit comments