Skip to content

Commit

Permalink
remove trivial mk_predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed May 29, 2020
1 parent 96dd469 commit 8f8cb71
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 8f8cb71

Please sign in to comment.