summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-11-26 21:51:55 +0000
committerMichael Goulet <michael@errs.io>2022-12-13 17:48:55 +0000
commit61adaf81873101587ffff4e1b8671acbc33d3df1 (patch)
tree7687aacda07f91463a43012ee10e0a5894557ac4 /compiler/rustc_mir_transform/src
parentc13bd83528da223fa073e9c7e5fdc435254baab6 (diff)
downloadrust-61adaf81873101587ffff4e1b8671acbc33d3df1.tar.gz
rust-61adaf81873101587ffff4e1b8671acbc33d3df1.zip
Combine projection and opaque into alias
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/inline.rs2
-rw-r--r--compiler/rustc_mir_transform/src/remove_zsts.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs
index f887dc5f2ea..ef7589d3ef2 100644
--- a/compiler/rustc_mir_transform/src/inline.rs
+++ b/compiler/rustc_mir_transform/src/inline.rs
@@ -849,7 +849,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
             };
 
             let kind = match parent_ty.ty.kind() {
-                &ty::Opaque(ty::AliasTy { def_id, substs }) => {
+                &ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => {
                     self.tcx.bound_type_of(def_id).subst(self.tcx, substs).kind()
                 }
                 kind => kind,
diff --git a/compiler/rustc_mir_transform/src/remove_zsts.rs b/compiler/rustc_mir_transform/src/remove_zsts.rs
index 569e783fee8..6cabef92d8c 100644
--- a/compiler/rustc_mir_transform/src/remove_zsts.rs
+++ b/compiler/rustc_mir_transform/src/remove_zsts.rs
@@ -52,7 +52,11 @@ impl<'tcx> MirPass<'tcx> for RemoveZsts {
 fn maybe_zst(ty: Ty<'_>) -> bool {
     match ty.kind() {
         // maybe ZST (could be more precise)
-        ty::Adt(..) | ty::Array(..) | ty::Closure(..) | ty::Tuple(..) | ty::Opaque(..) => true,
+        ty::Adt(..)
+        | ty::Array(..)
+        | ty::Closure(..)
+        | ty::Tuple(..)
+        | ty::Alias(ty::Opaque, ..) => true,
         // definitely ZST
         ty::FnDef(..) | ty::Never => true,
         // unreachable or can't be ZST