about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-10 16:38:53 -0700
committerTyler Mandry <tmandry@gmail.com>2019-10-14 15:48:36 -0700
commit802554f4274f6514cd2f8f618cae567adf18128f (patch)
treea9718275803cb2c7049ca7732260231431ad679b
parentfe09bb518d9dfb270a6f3562b50b96272524b42c (diff)
downloadrust-802554f4274f6514cd2f8f618cae567adf18128f.tar.gz
rust-802554f4274f6514cd2f8f618cae567adf18128f.zip
Only expand types that contain projections
-rw-r--r--src/librustc/ty/util.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs
index 35bd42fd744..6a94ca6b8c7 100644
--- a/src/librustc/ty/util.rs
+++ b/src/librustc/ty/util.rs
@@ -745,8 +745,10 @@ impl<'tcx> TyCtxt<'tcx> {
             fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
                 if let ty::Opaque(def_id, substs) = t.kind {
                     self.expand_opaque_ty(def_id, substs).unwrap_or(t)
-                } else {
+                } else if t.has_projections() {
                     t.super_fold_with(self)
+                } else {
+                    t
                 }
             }
         }