Skip to content

Commit 76f36dd

Browse files
committed
Also normalize GenericArgs in PostAnalysisNormalize.
1 parent f8ee261 commit 76f36dd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

compiler/rustc_mir_transform/src/post_analysis_normalize.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,16 @@ impl<'tcx> MutVisitor<'tcx> for PostAnalysisNormalizeVisitor<'tcx> {
8383
*ty = t;
8484
}
8585
}
86+
87+
#[inline]
88+
fn visit_args(&mut self, args: &mut ty::GenericArgsRef<'tcx>, _: Location) {
89+
// We have to use `try_normalize_erasing_regions` here, since it's
90+
// possible that we visit impossible-to-satisfy where clauses here,
91+
// see #91745
92+
if let Ok(a) =
93+
self.tcx.try_normalize_erasing_regions(self.typing_env, Unnormalized::new_wip(*args))
94+
{
95+
*args = a;
96+
}
97+
}
8698
}

0 commit comments

Comments
 (0)