Auto merge of #72754 - lcnr:predicate-fold, r=nikomatsakis

remove trivial `mk_predicate`s

r? @nikomatsakis
This commit is contained in:
bors 2020-06-03 20:12:40 +00:00
commit f3fadf6abd

View File

@ -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 {