Skip to content

Commit a715948

Browse files
Normalize opaques with escaping bound vars in AssocTypeNormalizer
1 parent 015a824 commit a715948

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+4
-4
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,15 +494,15 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
494494
// to make sure we don't forget to fold the substs regardless.
495495

496496
match *ty.kind() {
497-
// This is really important. While we *can* handle this, this has
498-
// severe performance implications for large opaque types with
499-
// late-bound regions. See `issue-88862` benchmark.
500-
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
497+
ty::Opaque(def_id, substs) => {
501498
// Only normalize `impl Trait` outside of type inference, usually in codegen.
502499
match self.param_env.reveal() {
503500
Reveal::UserFacing => ty.super_fold_with(self),
504501

505502
Reveal::All => {
503+
// N.b. there is an assumption here all this code can handle
504+
// escaping bound vars.
505+
506506
let recursion_limit = self.tcx().recursion_limit();
507507
if !recursion_limit.value_within_limit(self.depth) {
508508
let obligation = Obligation::with_depth(

0 commit comments

Comments
 (0)