Skip to content

Commit 534a5d1

Browse files
Fast path fold_predicate in old canonicalizer
1 parent 3de4f1c commit 534a5d1

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
@@ -515,6 +515,10 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
515515
ct
516516
}
517517
}
518+
519+
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
520+
if p.flags().intersects(self.needs_canonical_flags) { p.super_fold_with(self) } else { p }
521+
}
518522
}
519523

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

0 commit comments

Comments
 (0)