]> git.lizzy.rs Git - rust.git/commitdiff
Get rid of `node_levels` and `node_lint_levels`
authorJonas Schievink <jonas@schievink.net>
Sun, 10 Jul 2016 23:21:12 +0000 (01:21 +0200)
committerJonas Schievink <jonas@schievink.net>
Sun, 10 Jul 2016 23:21:12 +0000 (01:21 +0200)
src/librustc/lint/context.rs
src/librustc/ty/context.rs

index 8d032fd98baaae4e1b818d862a3b73d32dd2bcc4..ce3d72de9ae99a5378cfbbf598833ae4e7cda408 100644 (file)
@@ -35,7 +35,6 @@
 use lint::builtin;
 use util::nodemap::FnvHashMap;
 
-use std::cell::RefCell;
 use std::cmp;
 use std::default::Default as StdDefault;
 use std::mem;
@@ -311,10 +310,6 @@ pub struct LateContext<'a, 'tcx: 'a> {
     /// levels, this stack keeps track of the previous lint levels of whatever
     /// was modified.
     level_stack: Vec<(LintId, LevelSource)>,
-
-    /// Level of lints for certain NodeIds, stored here because the body of
-    /// the lint needs to run in trans.
-    node_levels: RefCell<FnvHashMap<(ast::NodeId, LintId), LevelSource>>,
 }
 
 /// Context for lint checking of the AST, after expansion, before lowering to
@@ -664,7 +659,6 @@ fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             access_levels: access_levels,
             lints: lint_store,
             level_stack: vec![],
-            node_levels: RefCell::new(FnvHashMap()),
         }
     }
 
@@ -1202,8 +1196,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         }
     }
 
-    *tcx.node_lint_levels.borrow_mut() = cx.node_levels.into_inner();
-
     // Put the lint store back in the session.
     mem::replace(&mut *tcx.sess.lint_store.borrow_mut(), cx.lints);
 }
index 4c8fa80dd0b9669acff4ea2d9c13422681943b10..56938a7a838588d0e0c5d757b1eab9e877e4b763 100644 (file)
@@ -12,7 +12,6 @@
 
 use dep_graph::{DepGraph, DepTrackingMap};
 use session::Session;
-use lint;
 use middle;
 use middle::cstore::LOCAL_CRATE;
 use hir::def::DefMap;
@@ -415,9 +414,6 @@ pub struct GlobalCtxt<'tcx> {
     /// Cache used by const_eval when decoding extern const fns
     pub extern_const_fns: RefCell<DefIdMap<NodeId>>,
 
-    pub node_lint_levels: RefCell<FnvHashMap<(NodeId, lint::LintId),
-                                              lint::LevelSource>>,
-
     /// Maps any item's def-id to its stability index.
     pub stability: RefCell<stability::Index<'tcx>>,
 
@@ -726,7 +722,6 @@ pub fn create_and_enter<F, R>(s: &'tcx Session,
             populated_external_primitive_impls: RefCell::new(DefIdSet()),
             extern_const_statics: RefCell::new(DefIdMap()),
             extern_const_fns: RefCell::new(DefIdMap()),
-            node_lint_levels: RefCell::new(FnvHashMap()),
             stability: RefCell::new(stability),
             selection_cache: traits::SelectionCache::new(),
             evaluation_cache: traits::EvaluationCache::new(),