Skip to content

Commit

Permalink
Rollup 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
Dylan-DPC authored Jun 3, 2020
2 parents 3d39d79 + 8f8cb71 commit f14c1d4
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 f14c1d4

Please sign in to comment.