Skip to content

Commit f3fadf6

Browse files
committed
Auto merge of rust-lang#72754 - lcnr:predicate-fold, r=nikomatsakis
remove trivial `mk_predicate`s r? @nikomatsakis
2 parents 56daaf6 + 8f8cb71 commit f3fadf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_middle/ty/structural_impls.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,8 @@ impl<'tcx> TypeFoldable<'tcx> for ty::Region<'tcx> {
987987

988988
impl<'tcx> TypeFoldable<'tcx> for ty::Predicate<'tcx> {
989989
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
990-
folder.tcx().mk_predicate(ty::PredicateKind::super_fold_with(self.kind, folder))
990+
let new = ty::PredicateKind::super_fold_with(self.kind, folder);
991+
if new != *self.kind { folder.tcx().mk_predicate(new) } else { *self }
991992
}
992993

993994
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {

0 commit comments

Comments
 (0)