for (predicate, _) in predicates.predicates {
debug!("predicate {:?}", predicate);
match predicate {
- ty::Predicate::Trait(trait_predicate, _) => {
+ ty::PredicateKind::Trait(trait_predicate, _) => {
let entry = types.entry(trait_predicate.skip_binder().self_ty()).or_default();
let def_id = trait_predicate.skip_binder().def_id();
if Some(def_id) != tcx.lang_items().sized_trait() {
entry.push(trait_predicate.skip_binder().def_id());
}
}
- ty::Predicate::Projection(projection_pred) => {
+ ty::PredicateKind::Projection(projection_pred) => {
projections.push(projection_pred);
}
_ => {}
parent: None,
predicates: tcx.arena.alloc_from_iter(self.param_env.caller_bounds.iter().filter_map(
|&predicate| match predicate {
- ty::Predicate::Trait(ref data, _)
+ ty::PredicateKind::Trait(ref data, _)
if data.skip_binder().self_ty().is_param(index) =>
{
// HACK(eddyb) should get the original `Span`.
self.register_predicate(traits::Obligation::new(
cause,
self.param_env,
- ty::Predicate::ConstEvaluatable(def_id, substs),
+ ty::PredicateKind::ConstEvaluatable(def_id, substs),
));
}
self.register_predicate(traits::Obligation::new(
cause,
self.param_env,
- ty::Predicate::WellFormed(ty),
+ ty::PredicateKind::WellFormed(ty),
));
}
.pending_obligations()
.into_iter()
.filter_map(move |obligation| match obligation.predicate {
- ty::Predicate::Projection(ref data) => {
+ ty::PredicateKind::Projection(ref data) => {
Some((data.to_poly_trait_ref(self.tcx), obligation))
}
- ty::Predicate::Trait(ref data, _) => Some((data.to_poly_trait_ref(), obligation)),
- ty::Predicate::Subtype(..) => None,
- ty::Predicate::RegionOutlives(..) => None,
- ty::Predicate::TypeOutlives(..) => None,
- ty::Predicate::WellFormed(..) => None,
- ty::Predicate::ObjectSafe(..) => None,
- ty::Predicate::ConstEvaluatable(..) => None,
- ty::Predicate::ConstEquate(..) => None,
+ ty::PredicateKind::Trait(ref data, _) => {
+ Some((data.to_poly_trait_ref(), obligation))
+ }
+ ty::PredicateKind::Subtype(..) => None,
+ ty::PredicateKind::RegionOutlives(..) => None,
+ ty::PredicateKind::TypeOutlives(..) => None,
+ ty::PredicateKind::WellFormed(..) => None,
+ ty::PredicateKind::ObjectSafe(..) => None,
+ ty::PredicateKind::ConstEvaluatable(..) => None,
+ ty::PredicateKind::ConstEquate(..) => None,
// N.B., this predicate is created by breaking down a
// `ClosureType: FnFoo()` predicate, where
// `ClosureType` represents some `Closure`. It can't
// this closure yet; this is exactly why the other
// code is looking for a self type of a unresolved
// inference variable.
- ty::Predicate::ClosureKind(..) => None,
+ ty::PredicateKind::ClosureKind(..) => None,
})
.filter(move |(tr, _)| self.self_type_matches_expected_vid(*tr, ty_var_root))
}
continue;
}
- if let ty::Predicate::Trait(predicate, _) = error.obligation.predicate {
+ if let ty::PredicateKind::Trait(predicate, _) = error.obligation.predicate {
// Collect the argument position for all arguments that could have caused this
// `FulfillmentError`.
let mut referenced_in = final_arg_types
if let hir::ExprKind::Path(qpath) = &path.kind {
if let hir::QPath::Resolved(_, path) = &qpath {
for error in errors {
- if let ty::Predicate::Trait(predicate, _) = error.obligation.predicate {
+ if let ty::PredicateKind::Trait(predicate, _) = error.obligation.predicate {
// If any of the type arguments in this path segment caused the
// `FullfillmentError`, point at its span (#61860).
for arg in path
};
let predicate =
- ty::Predicate::Projection(ty::Binder::bind(ty::ProjectionPredicate {
+ ty::PredicateKind::Projection(ty::Binder::bind(ty::ProjectionPredicate {
projection_ty,
ty: expected,
}));