@@ -61,7 +61,7 @@ pub struct LintStore {
6161 passes : Option < Vec < LintPassObject > > ,
6262
6363 /// Lints indexed by name.
64- by_name : HashMap < & ' static str , LintId > ,
64+ by_name : HashMap < String , LintId > ,
6565
6666 /// Current levels of each lint, and where they were set.
6767 levels : HashMap < LintId , LevelSource > ,
@@ -102,8 +102,8 @@ impl LintStore {
102102 self . lints . push ( ( lint, from_plugin) ) ;
103103
104104 let id = LintId :: of ( lint) ;
105- if !self . by_name . insert ( lint. name , id) {
106- let msg = format ! ( "duplicate specification of lint {}" , lint. name ) ;
105+ if !self . by_name . insert ( lint. name_lower ( ) , id) {
106+ let msg = format ! ( "duplicate specification of lint {}" , lint. name_lower ( ) ) ;
107107 match ( sess, from_plugin) {
108108 // We load builtin lints first, so a duplicate is a compiler bug.
109109 // Use early_error when handling -W help with no crate.
@@ -205,18 +205,19 @@ pub fn raw_emit_lint(sess: &Session, lint: &'static Lint,
205205 let ( mut level, source) = lvlsrc;
206206 if level == Allow { return }
207207
208+ let name = lint. name_lower ( ) ;
208209 let mut note = None ;
209210 let msg = match source {
210211 Default => {
211212 format ! ( "{}, #[{}({})] on by default" , msg,
212- level. as_str( ) , lint . name)
213+ level. as_str( ) , name)
213214 } ,
214215 CommandLine => {
215216 format ! ( "{} [-{} {}]" , msg,
216217 match level {
217218 Warn => 'W' , Deny => 'D' , Forbid => 'F' ,
218219 Allow => fail!( )
219- } , lint . name. replace( "_" , "-" ) )
220+ } , name. replace( "_" , "-" ) )
220221 } ,
221222 Node ( src) => {
222223 note = Some ( src) ;
@@ -355,7 +356,7 @@ impl<'a> Context<'a> {
355356 for meta in metas. iter ( ) {
356357 match meta. node {
357358 ast:: MetaWord ( ref lint_name) => {
358- match self . lints . by_name . find_equiv ( lint_name) {
359+ match self . lints . by_name . find_equiv ( & lint_name. get ( ) ) {
359360 Some ( lint_id) => out. push ( ( * lint_id, level, meta. span ) ) ,
360361
361362 None => self . span_lint ( builtin:: unrecognized_lint,
0 commit comments