Skip to content

Commit b8a92c1

Browse files
Revert "Normalize opaques with escaping bound vars"
This reverts commit 43119d6.
1 parent fd3bfb3 commit b8a92c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
508508
// This is really important. While we *can* handle this, this has
509509
// severe performance implications for large opaque types with
510510
// late-bound regions. See `issue-88862` benchmark.
511-
ty::Opaque(def_id, substs) => {
511+
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
512512
// Only normalize `impl Trait` outside of type inference, usually in codegen.
513513
match self.param_env.reveal() {
514514
Reveal::UserFacing => ty.super_fold_with(self),

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
198198
// This is really important. While we *can* handle this, this has
199199
// severe performance implications for large opaque types with
200200
// late-bound regions. See `issue-88862` benchmark.
201-
ty::Opaque(def_id, substs) => {
201+
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
202202
// Only normalize `impl Trait` outside of type inference, usually in codegen.
203203
match self.param_env.reveal() {
204204
Reveal::UserFacing => ty.try_super_fold_with(self),

0 commit comments

Comments
 (0)