@@ -13,7 +13,7 @@ use rustc_span::{symbol, Span, Symbol, DUMMY_SP};
1313
1414/// How a lint level was set.
1515#[ derive( Clone , Copy , PartialEq , Eq , HashStable ) ]
16- pub enum LintSource {
16+ pub enum LintLevelSource {
1717 /// Lint is at the default level as declared
1818 /// in rustc or a plugin.
1919 Default ,
@@ -27,25 +27,25 @@ pub enum LintSource {
2727 CommandLine ( Symbol , Level ) ,
2828}
2929
30- impl LintSource {
30+ impl LintLevelSource {
3131 pub fn name ( & self ) -> Symbol {
3232 match * self {
33- LintSource :: Default => symbol:: kw:: Default ,
34- LintSource :: Node ( name, _, _) => name,
35- LintSource :: CommandLine ( name, _) => name,
33+ LintLevelSource :: Default => symbol:: kw:: Default ,
34+ LintLevelSource :: Node ( name, _, _) => name,
35+ LintLevelSource :: CommandLine ( name, _) => name,
3636 }
3737 }
3838
3939 pub fn span ( & self ) -> Span {
4040 match * self {
41- LintSource :: Default => DUMMY_SP ,
42- LintSource :: Node ( _, span, _) => span,
43- LintSource :: CommandLine ( _, _) => DUMMY_SP ,
41+ LintLevelSource :: Default => DUMMY_SP ,
42+ LintLevelSource :: Node ( _, span, _) => span,
43+ LintLevelSource :: CommandLine ( _, _) => DUMMY_SP ,
4444 }
4545 }
4646}
4747
48- pub type LevelSource = ( Level , LintSource ) ;
48+ pub type LevelSource = ( Level , LintLevelSource ) ;
4949
5050pub struct LintLevelSets {
5151 pub list : Vec < LintSet > ,
@@ -113,7 +113,7 @@ impl LintLevelSets {
113113 id : LintId ,
114114 mut idx : u32 ,
115115 aux : Option < & FxHashMap < LintId , LevelSource > > ,
116- ) -> ( Option < Level > , LintSource ) {
116+ ) -> ( Option < Level > , LintLevelSource ) {
117117 if let Some ( specs) = aux {
118118 if let Some ( & ( level, src) ) = specs. get ( & id) {
119119 return ( Some ( level) , src) ;
@@ -125,7 +125,7 @@ impl LintLevelSets {
125125 if let Some ( & ( level, src) ) = specs. get ( & id) {
126126 return ( Some ( level) , src) ;
127127 }
128- return ( None , LintSource :: Default ) ;
128+ return ( None , LintLevelSource :: Default ) ;
129129 }
130130 LintSet :: Node { ref specs, parent } => {
131131 if let Some ( & ( level, src) ) = specs. get ( & id) {
@@ -213,7 +213,7 @@ pub fn struct_lint_level<'s, 'd>(
213213 sess : & ' s Session ,
214214 lint : & ' static Lint ,
215215 level : Level ,
216- src : LintSource ,
216+ src : LintLevelSource ,
217217 span : Option < MultiSpan > ,
218218 decorate : impl for < ' a > FnOnce ( LintDiagnosticBuilder < ' a > ) + ' d ,
219219) {
@@ -223,7 +223,7 @@ pub fn struct_lint_level<'s, 'd>(
223223 sess : & ' s Session ,
224224 lint : & ' static Lint ,
225225 level : Level ,
226- src : LintSource ,
226+ src : LintLevelSource ,
227227 span : Option < MultiSpan > ,
228228 decorate : Box < dyn for < ' b > FnOnce ( LintDiagnosticBuilder < ' b > ) + ' d > ,
229229 ) {
@@ -274,14 +274,14 @@ pub fn struct_lint_level<'s, 'd>(
274274
275275 let name = lint. name_lower ( ) ;
276276 match src {
277- LintSource :: Default => {
277+ LintLevelSource :: Default => {
278278 sess. diag_note_once (
279279 & mut err,
280280 DiagnosticMessageId :: from ( lint) ,
281281 & format ! ( "`#[{}({})]` on by default" , level. as_str( ) , name) ,
282282 ) ;
283283 }
284- LintSource :: CommandLine ( lint_flag_val, orig_level) => {
284+ LintLevelSource :: CommandLine ( lint_flag_val, orig_level) => {
285285 let flag = match orig_level {
286286 Level :: Warn => "-W" ,
287287 Level :: Deny => "-D" ,
@@ -310,7 +310,7 @@ pub fn struct_lint_level<'s, 'd>(
310310 ) ;
311311 }
312312 }
313- LintSource :: Node ( lint_attr_name, src, reason) => {
313+ LintLevelSource :: Node ( lint_attr_name, src, reason) => {
314314 if let Some ( rationale) = reason {
315315 err. note ( & rationale. as_str ( ) ) ;
316316 }
0 commit comments