Skip to content

Commit

Permalink
Auto merge of rust-lang#72754 - lcnr:predicate-fold, r=nikomatsakis
Browse files Browse the repository at this point in the history
remove trivial `mk_predicate`s

r? @nikomatsakis
  • Loading branch information
bors committed Jun 3, 2020
2 parents 56daaf6 + 8f8cb71 commit f3fadf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_middle/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ impl<'tcx> TypeFoldable<'tcx> for ty::Region<'tcx> {

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

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

0 comments on commit f3fadf6

Please sign in to comment.