]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/hair/cx/mod.rs
Rollup merge of #64895 - davidtwco:issue-64130-async-error-definition, r=nikomatsakis
[rust.git] / src / librustc_mir / hair / cx / mod.rs
index 676827d3b3eba44a5041ba960b466d2b4acf5232..e120b496d3d09c57eea70c65f447d07537fd0f3f 100644 (file)
@@ -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,
@@ -153,16 +153,12 @@ pub fn const_eval_literal(
         }
     }
 
-    pub fn pattern_from_hir(&mut self, p: &hir::Pat) -> Pattern<'tcx> {
-        let tcx = self.tcx.global_tcx();
-        let p = match tcx.hir().get(p.hir_id) {
+    pub fn pattern_from_hir(&mut self, p: &hir::Pat) -> Pat<'tcx> {
+        let p = match self.tcx.hir().get(p.hir_id) {
             Node::Pat(p) | Node::Binding(p) => p,
             node => bug!("pattern became {:?}", node)
         };
-        Pattern::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,
@@ -190,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> {