1
Fork 0

Update w/ comments

Removes uses of ty() where a method is implemented on TypeFoldable, and also directly formats
a Term.
This commit is contained in:
kadmin 2022-01-11 19:18:18 +00:00
parent e7529d6a38
commit f396888c4d
10 changed files with 21 additions and 32 deletions

View file

@ -128,10 +128,7 @@ where
polarity: _,
}) => self.visit_trait(trait_ref),
ty::PredicateKind::Projection(ty::ProjectionPredicate { projection_ty, term }) => {
match term {
ty::Term::Ty(ty) => ty.visit_with(self)?,
ty::Term::Const(ct) => ct.visit_with(self)?,
}
term.visit_with(self)?;
self.visit_projection_ty(projection_ty)
}
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty, _region)) => {
@ -1189,10 +1186,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
for (poly_predicate, _) in bounds.projection_bounds {
let pred = poly_predicate.skip_binder();
let poly_pred_term = match pred.term {
ty::Term::Ty(ty) => self.visit(ty),
ty::Term::Const(ct) => self.visit(ct),
};
let poly_pred_term = self.visit(pred.term);
if poly_pred_term.is_break()
|| self.visit_projection_ty(pred.projection_ty).is_break()
{