X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Ftraits%2Fquery%2Fnormalize.rs;h=c6ef13e185b2d7526e6870397a3932e451e6a49c;hb=39b2a41b39b445bf7efab02f6eade16135d7df85;hp=7ad532d8a34645544996dd1930fbf45284d9d1b7;hpb=1ce18d2d658eb8b1625965e5a50d040d5c8f05c1;p=rust.git diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs index 7ad532d8a34..c6ef13e185b 100644 --- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs @@ -205,7 +205,9 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result, Self::Error> { // This is really important. While we *can* handle this, this has // severe performance implications for large opaque types with // late-bound regions. See `issue-88862` benchmark. - ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => { + ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) + if !substs.has_escaping_bound_vars() => + { // Only normalize `impl Trait` outside of type inference, usually in codegen. match self.param_env.reveal() { Reveal::UserFacing => ty.try_super_fold_with(self), @@ -242,7 +244,7 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result, Self::Error> { } } - ty::Projection(data) if !data.has_escaping_bound_vars() => { + ty::Alias(ty::Projection, data) if !data.has_escaping_bound_vars() => { // This branch is just an optimization: when we don't have escaping bound vars, // we don't need to replace them with placeholders (see branch below). @@ -291,7 +293,7 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result, Self::Error> { } } - ty::Projection(data) => { + ty::Alias(ty::Projection, data) => { // See note in `rustc_trait_selection::traits::project` let tcx = self.infcx.tcx;