@@ -29,13 +29,12 @@ use dep_graph::DepNode;
2929use middle:: privacy:: AccessLevels ;
3030use ty:: TyCtxt ;
3131use session:: { config, early_error, Session } ;
32- use lint:: { Level , LevelSource , Lint , LintId , LintArray , LintPass } ;
33- use lint:: { EarlyLintPassObject , LateLintPass , LateLintPassObject } ;
32+ use lint:: { Level , LevelSource , Lint , LintId , LintPass } ;
33+ use lint:: { EarlyLintPassObject , LateLintPassObject } ;
3434use lint:: { Default , CommandLine , Node , Allow , Warn , Deny , Forbid } ;
3535use lint:: builtin;
3636use util:: nodemap:: FnvHashMap ;
3737
38- use std:: cell:: RefCell ;
3938use std:: cmp;
4039use std:: default:: Default as StdDefault ;
4140use std:: mem;
@@ -311,10 +310,6 @@ pub struct LateContext<'a, 'tcx: 'a> {
311310 /// levels, this stack keeps track of the previous lint levels of whatever
312311 /// was modified.
313312 level_stack : Vec < ( LintId , LevelSource ) > ,
314-
315- /// Level of lints for certain NodeIds, stored here because the body of
316- /// the lint needs to run in trans.
317- node_levels : RefCell < FnvHashMap < ( ast:: NodeId , LintId ) , LevelSource > > ,
318313}
319314
320315/// Context for lint checking of the AST, after expansion, before lowering to
@@ -664,7 +659,6 @@ impl<'a, 'tcx> LateContext<'a, 'tcx> {
664659 access_levels : access_levels,
665660 lints : lint_store,
666661 level_stack : vec ! [ ] ,
667- node_levels : RefCell :: new ( FnvHashMap ( ) ) ,
668662 }
669663 }
670664
@@ -1064,38 +1058,6 @@ impl<'a, 'tcx> IdVisitingOperation for LateContext<'a, 'tcx> {
10641058 }
10651059}
10661060
1067- // This lint pass is defined here because it touches parts of the `LateContext`
1068- // that we don't want to expose. It records the lint level at certain AST
1069- // nodes, so that the variant size difference check in trans can call
1070- // `raw_emit_lint`.
1071-
1072- pub struct GatherNodeLevels ;
1073-
1074- impl LintPass for GatherNodeLevels {
1075- fn get_lints ( & self ) -> LintArray {
1076- lint_array ! ( )
1077- }
1078- }
1079-
1080- impl LateLintPass for GatherNodeLevels {
1081- fn check_item ( & mut self , cx : & LateContext , it : & hir:: Item ) {
1082- match it. node {
1083- hir:: ItemEnum ( ..) => {
1084- let lint_id = LintId :: of ( builtin:: VARIANT_SIZE_DIFFERENCES ) ;
1085- let lvlsrc = cx. lints . get_level_source ( lint_id) ;
1086- match lvlsrc {
1087- ( lvl, _) if lvl != Allow => {
1088- cx. node_levels . borrow_mut ( )
1089- . insert ( ( it. id , lint_id) , lvlsrc) ;
1090- } ,
1091- _ => { }
1092- }
1093- } ,
1094- _ => { }
1095- }
1096- }
1097- }
1098-
10991061enum CheckLintNameResult {
11001062 Ok ,
11011063 // Lint doesn't exist
@@ -1234,8 +1196,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12341196 }
12351197 }
12361198
1237- * tcx. node_lint_levels . borrow_mut ( ) = cx. node_levels . into_inner ( ) ;
1238-
12391199 // Put the lint store back in the session.
12401200 mem:: replace ( & mut * tcx. sess . lint_store . borrow_mut ( ) , cx. lints ) ;
12411201}
0 commit comments