@@ -72,7 +72,7 @@ use syntax::parse::token;
7272use syntax:: visit:: Visitor ;
7373use syntax:: { ast, ast_util, visit} ;
7474
75- #[ deriving( Clone , Show , Eq , Ord , TotalEq , TotalOrd ) ]
75+ #[ deriving( Clone , Show , Eq , Ord , TotalEq , TotalOrd , Hash ) ]
7676pub enum Lint {
7777 CTypes ,
7878 UnusedImports ,
@@ -471,9 +471,9 @@ struct Context<'a> {
471471 /// Ids of structs/enums which have been checked for raw_pointer_deriving
472472 checked_raw_pointers : NodeSet ,
473473
474- /// Level of EnumSizeVariance lint for each enum , stored here because the
475- /// body of the lint needs to run in trans.
476- enum_levels : HashMap < ast:: NodeId , ( Level , LintSource ) > ,
474+ /// Level of lints for certain NodeIds , stored here because the body of
475+ /// the lint needs to run in trans.
476+ node_levels : HashMap < ( ast:: NodeId , Lint ) , ( Level , LintSource ) > ,
477477}
478478
479479pub fn emit_lint ( level : Level , src : LintSource , msg : & str , span : Span ,
@@ -1921,7 +1921,7 @@ pub fn check_crate(tcx: &ty::ctxt,
19211921 lint_stack : Vec :: new ( ) ,
19221922 negated_expr_id : -1 ,
19231923 checked_raw_pointers : NodeSet :: new ( ) ,
1924- enum_levels : HashMap :: new ( ) ,
1924+ node_levels : HashMap :: new ( ) ,
19251925 } ;
19261926
19271927 // Install default lint levels, followed by the command line levels, and
@@ -1963,5 +1963,5 @@ pub fn check_crate(tcx: &ty::ctxt,
19631963 }
19641964
19651965 tcx. sess . abort_if_errors ( ) ;
1966- * tcx. enum_lint_levels . borrow_mut ( ) = cx. enum_levels ;
1966+ * tcx. node_lint_levels . borrow_mut ( ) = cx. node_levels ;
19671967}
0 commit comments