]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_passes/rvalue_promotion.rs
Remove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Gener...
[rust.git] / src / librustc_passes / rvalue_promotion.rs
index d223dc2a353356799375a9aa818905415b1c0879..fca1c7f27ab37a590274385579ca5b7cf94a2efe 100644 (file)
@@ -248,7 +248,8 @@ fn check_nested_body(&mut self, body_id: hir::BodyId) -> Promotability {
         let tcx = self.tcx;
         let param_env = self.param_env;
         let region_scope_tree = self.tcx.region_scope_tree(item_def_id);
-        euv::ExprUseVisitor::new(self, tcx, param_env, &region_scope_tree, self.tables, None)
+        let tables = self.tables;
+        euv::ExprUseVisitor::new(self, tcx, param_env, &region_scope_tree, tables, None)
             .consume_body(body);
 
         let body_promotable = self.check_expr(&body.value);
@@ -327,7 +328,7 @@ fn check_expr_kind<'a, 'tcx>(
     e: &'tcx hir::Expr, node_ty: Ty<'tcx>) -> Promotability {
 
     let ty_result = match node_ty.sty {
-        ty::TyAdt(def, _) if def.has_dtor(v.tcx) => {
+        ty::Adt(def, _) if def.has_dtor(v.tcx) => {
             NotPromotable
         }
         _ => Promotable
@@ -355,7 +356,7 @@ fn check_expr_kind<'a, 'tcx>(
                 return NotPromotable;
             }
             match v.tables.node_id_to_type(lhs.hir_id).sty {
-                ty::TyRawPtr(_) => {
+                ty::RawPtr(_) => {
                     assert!(op.node == hir::BinOpKind::Eq || op.node == hir::BinOpKind::Ne ||
                         op.node == hir::BinOpKind::Le || op.node == hir::BinOpKind::Lt ||
                         op.node == hir::BinOpKind::Ge || op.node == hir::BinOpKind::Gt);
@@ -493,7 +494,7 @@ fn check_expr_kind<'a, 'tcx>(
                 Some(ref expr) => { struct_result = struct_result & v.check_expr(&expr); },
                 None => {},
             }
-            if let ty::TyAdt(adt, ..) = v.tables.expr_ty(e).sty {
+            if let ty::Adt(adt, ..) = v.tables.expr_ty(e).sty {
                 // unsafe_cell_type doesn't necessarily exist with no_core
                 if Some(adt.did) == v.tcx.lang_items().unsafe_cell_type() {
                     return NotPromotable;