diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-08-11 12:35:54 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-08-14 11:21:34 +0200 |
| commit | 6fd7d8586c606e3ca03511bd915946a8e75c2db7 (patch) | |
| tree | a574a837f0e0116de958a763408d109c201227eb | |
| parent | a69eaf62c5e325c96c9924102829a42cbfd37424 (diff) | |
| download | rust-6fd7d8586c606e3ca03511bd915946a8e75c2db7.tar.gz rust-6fd7d8586c606e3ca03511bd915946a8e75c2db7.zip | |
Fix some merge fallout.
| -rw-r--r-- | src/librustc/hir/def_id.rs | 7 | ||||
| -rw-r--r-- | src/librustc/middle/dead.rs | 2 | ||||
| -rw-r--r-- | src/librustc/ty/context.rs | 1 | ||||
| -rw-r--r-- | src/librustc_borrowck/borrowck/gather_loans/mod.rs | 3 | ||||
| -rw-r--r-- | src/librustc_lint/unused.rs | 4 | ||||
| -rw-r--r-- | src/librustc_privacy/lib.rs | 2 |
6 files changed, 4 insertions, 15 deletions
diff --git a/src/librustc/hir/def_id.rs b/src/librustc/hir/def_id.rs index bb3b248674a..7f76e1bf770 100644 --- a/src/librustc/hir/def_id.rs +++ b/src/librustc/hir/def_id.rs @@ -201,11 +201,4 @@ impl DefId { pub fn is_local(&self) -> bool { self.krate == LOCAL_CRATE } - - pub fn invalid() -> DefId { - DefId { - krate: INVALID_CRATE, - index: CRATE_DEF_INDEX, - } - } } diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index ed04186eb28..8a2b115e58d 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -119,8 +119,6 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> { fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, def: Def, pats: &[codemap::Spanned<hir::FieldPat>]) { - - let variant = match self.tables.node_id_to_type(lhs.hir_id).sty { ty::TyAdt(adt, _) => adt.variant_of_def(def), _ => span_bug!(lhs.span, "non-ADT in struct pattern") diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index d93750ec04e..2ef65a26b4b 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -285,7 +285,6 @@ pub struct LocalTableInContextMut<'a, V: 'a> { } impl<'a, V> LocalTableInContextMut<'a, V> { - pub fn get_mut(&mut self, id: hir::HirId) -> Option<&mut V> { validate_hir_id_for_typeck_tables(self.local_id_root, id, true); self.data.get_mut(&id.local_id) diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index 7a89d1f09d3..35af83c8ae2 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -449,7 +449,8 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> { } None } - LpUpvar(ty::UpvarId{ var_id: local_id, closure_expr_id: _ }) => { + LpUpvar(ty::UpvarId{ var_id, closure_expr_id: _ }) => { + let local_id = self.tcx().hir.def_index_to_node_id(var_id); self.tcx().used_mut_nodes.borrow_mut().insert(local_id); None } diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 65973d99c54..9b90360109e 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -155,12 +155,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults { let maybe_def = match expr.node { hir::ExprCall(ref callee, _) => { match callee.node { - hir::ExprPath(ref qpath) => Some(cx.tables.qpath_def(qpath, callee.id)), + hir::ExprPath(ref qpath) => Some(cx.tables.qpath_def(qpath, callee.hir_id)), _ => None } }, hir::ExprMethodCall(..) => { - cx.tables.type_dependent_defs.get(&expr.id).cloned() + cx.tables.type_dependent_defs().get(expr.hir_id).cloned() }, _ => { None } }; diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 373d7911cf9..76a8850291f 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1655,10 +1655,8 @@ fn privacy_access_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, assert_eq!(krate, LOCAL_CRATE); let krate = tcx.hir.krate(); - let empty_tables = ty::TypeckTables::empty(None); - // Check privacy of names not checked in previous compilation stages. let mut visitor = NamePrivacyVisitor { tcx: tcx, |
