]> 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 114fd8754a21fb21e256eb765c56d6f53f42d062..fca1c7f27ab37a590274385579ca5b7cf94a2efe 100644 (file)
@@ -328,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
@@ -356,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);
@@ -494,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;