Skip to content

Commit 84a3255

Browse files
Fast path fold_predicate in old canonicalizer
1 parent aa57e46 commit 84a3255

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
493493
ct
494494
}
495495
}
496+
497+
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
498+
if p.flags().intersects(self.needs_canonical_flags) { p.super_fold_with(self) } else { p }
499+
}
496500
}
497501

498502
impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {

0 commit comments

Comments
 (0)