Skip to content

Commit 664cf93

Browse files
norm
1 parent c79d6be commit 664cf93

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
500500
// to make sure we don't forget to fold the substs regardless.
501501

502502
match kind {
503-
// This is really important. While we *can* handle this, this has
504-
// severe performance implications for large opaque types with
505-
// late-bound regions. See `issue-88862` benchmark.
506-
ty::Opaque if !data.substs.has_escaping_bound_vars() => {
503+
ty::Opaque => {
507504
// Only normalize `impl Trait` outside of type inference, usually in codegen.
508505
match self.param_env.reveal() {
509506
Reveal::UserFacing => ty.super_fold_with(self),
@@ -529,7 +526,6 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
529526
}
530527
}
531528
}
532-
ty::Opaque => ty.super_fold_with(self),
533529

534530
ty::Projection if !data.has_escaping_bound_vars() => {
535531
// This branch is *mostly* just an optimization: when we don't

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx>
211211

212212
// Wrap this in a closure so we don't accidentally return from the outer function
213213
let res = match kind {
214-
// This is really important. While we *can* handle this, this has
215-
// severe performance implications for large opaque types with
216-
// late-bound regions. See `issue-88862` benchmark.
217-
ty::Opaque if !data.substs.has_escaping_bound_vars() => {
214+
ty::Opaque => {
218215
// Only normalize `impl Trait` outside of type inference, usually in codegen.
219216
match self.param_env.reveal() {
220217
Reveal::UserFacing => ty.try_super_fold_with(self)?,
@@ -255,8 +252,6 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx>
255252
}
256253
}
257254

258-
ty::Opaque => ty.try_super_fold_with(self)?,
259-
260255
ty::Projection | ty::Inherent | ty::Weak => {
261256
// See note in `rustc_trait_selection::traits::project`
262257

0 commit comments

Comments
 (0)