From 66fb62baf7a655e0b08f2d61f7e186ac0ac18045 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 11 Jul 2016 01:21:12 +0200 Subject: [PATCH] Get rid of `node_levels` and `node_lint_levels` --- src/librustc/lint/context.rs | 8 -------- src/librustc/ty/context.rs | 5 ----- 2 files changed, 13 deletions(-) diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 8d032fd98baaa..ce3d72de9ae99 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -35,7 +35,6 @@ use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid}; 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>, } /// Context for lint checking of the AST, after expansion, before lowering to @@ -664,7 +659,6 @@ impl<'a, 'tcx> LateContext<'a, '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); } diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 4c8fa80dd0b96..56938a7a83858 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -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>, - pub node_lint_levels: RefCell>, - /// Maps any item's def-id to its stability index. pub stability: RefCell>, @@ -726,7 +722,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { 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(),