X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fhair%2Fcx%2Fmod.rs;h=e120b496d3d09c57eea70c65f447d07537fd0f3f;hb=25f774a4cfe4a2686de6c6d628db33c65e231039;hp=f7cd29f2e67ef591e02af4607b812c2961cf5feb;hpb=a60ac8ee0b6450042446fc6523c20c9735103bad;p=rust.git diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index f7cd29f2e67..e120b496d3d 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -5,7 +5,7 @@ use crate::hair::*; use crate::hair::util::UserAnnotatedTyHelpers; -use rustc_data_structures::indexed_vec::Idx; +use rustc_index::vec::Idx; use rustc::hir::def_id::DefId; use rustc::hir::Node; use rustc::middle::region; @@ -83,7 +83,7 @@ pub fn new(infcx: &'a InferCtxt<'a, 'tcx>, src_id: hir::HirId) -> Cx<'a, 'tcx> { infcx, root_lint_level: src_id, param_env: tcx.param_env(src_def_id), - identity_substs: InternalSubsts::identity_for_item(tcx.global_tcx(), src_def_id), + identity_substs: InternalSubsts::identity_for_item(tcx, src_def_id), region_scope_tree: tcx.region_scope_tree(src_def_id), tables, constness, @@ -154,12 +154,11 @@ pub fn const_eval_literal( } pub fn pattern_from_hir(&mut self, p: &hir::Pat) -> Pat<'tcx> { - let tcx = self.tcx.global_tcx(); - let p = match tcx.hir().get(p.hir_id) { + let p = match self.tcx.hir().get(p.hir_id) { Node::Pat(p) | Node::Binding(p) => p, node => bug!("pattern became {:?}", node) }; - Pat::from_hir(tcx, self.param_env.and(self.identity_substs), self.tables(), p) + Pat::from_hir(self.tcx, self.param_env.and(self.identity_substs), self.tables(), p) } pub fn trait_method(&mut self, @@ -187,7 +186,7 @@ pub fn all_fields(&mut self, adt_def: &ty::AdtDef, variant_index: VariantIdx) -> } pub fn needs_drop(&mut self, ty: Ty<'tcx>) -> bool { - ty.needs_drop(self.tcx.global_tcx(), self.param_env) + ty.needs_drop(self.tcx, self.param_env) } pub fn tcx(&self) -> TyCtxt<'tcx> {