Skip to content

Commit 8f8cb71

Browse files
committed
remove trivial mk_predicates
1 parent 96dd469 commit 8f8cb71

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)