@@ -29,13 +29,12 @@ use dep_graph::DepNode;
29
29
use middle:: privacy:: AccessLevels ;
30
30
use ty:: TyCtxt ;
31
31
use 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 } ;
34
34
use lint:: { Default , CommandLine , Node , Allow , Warn , Deny , Forbid } ;
35
35
use lint:: builtin;
36
36
use util:: nodemap:: FnvHashMap ;
37
37
38
- use std:: cell:: RefCell ;
39
38
use std:: cmp;
40
39
use std:: default:: Default as StdDefault ;
41
40
use std:: mem;
@@ -311,10 +310,6 @@ pub struct LateContext<'a, 'tcx: 'a> {
311
310
/// levels, this stack keeps track of the previous lint levels of whatever
312
311
/// was modified.
313
312
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 > > ,
318
313
}
319
314
320
315
/// Context for lint checking of the AST, after expansion, before lowering to
@@ -664,7 +659,6 @@ impl<'a, 'tcx> LateContext<'a, 'tcx> {
664
659
access_levels : access_levels,
665
660
lints : lint_store,
666
661
level_stack : vec ! [ ] ,
667
- node_levels : RefCell :: new ( FnvHashMap ( ) ) ,
668
662
}
669
663
}
670
664
@@ -1064,38 +1058,6 @@ impl<'a, 'tcx> IdVisitingOperation for LateContext<'a, 'tcx> {
1064
1058
}
1065
1059
}
1066
1060
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
-
1099
1061
enum CheckLintNameResult {
1100
1062
Ok ,
1101
1063
// Lint doesn't exist
@@ -1234,8 +1196,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1234
1196
}
1235
1197
}
1236
1198
1237
- * tcx. node_lint_levels . borrow_mut ( ) = cx. node_levels . into_inner ( ) ;
1238
-
1239
1199
// Put the lint store back in the session.
1240
1200
mem:: replace ( & mut * tcx. sess . lint_store . borrow_mut ( ) , cx. lints ) ;
1241
1201
}
0 commit comments