debug!("instantiate_opaque_types: ty_var={:?}", ty_var);
for predicate in &bounds.predicates {
- if let ty::PredicateKind::Projection(projection) = predicate.kind() {
- if projection.skip_binder().ty.references_error() {
+ if let ty::PredicateAtom::Projection(projection) = predicate.skip_binders() {
+ if projection.ty.references_error() {
// No point on adding these obligations since there's a type error involved.
return ty_var;
}
traits::elaborate_predicates(tcx, predicates)
.filter_map(|obligation| {
debug!("required_region_bounds(obligation={:?})", obligation);
- match obligation.predicate.kind() {
- ty::PredicateKind::Projection(..)
- | ty::PredicateKind::Trait(..)
- | ty::PredicateKind::Subtype(..)
- | ty::PredicateKind::WellFormed(..)
- | ty::PredicateKind::ObjectSafe(..)
- | ty::PredicateKind::ClosureKind(..)
- | ty::PredicateKind::RegionOutlives(..)
- | ty::PredicateKind::ConstEvaluatable(..)
- | ty::PredicateKind::ConstEquate(..) => None,
- ty::PredicateKind::TypeOutlives(predicate) => {
+ match obligation.predicate.skip_binders() {
+ ty::PredicateAtom::Projection(..)
+ | ty::PredicateAtom::Trait(..)
+ | ty::PredicateAtom::Subtype(..)
+ | ty::PredicateAtom::WellFormed(..)
+ | ty::PredicateAtom::ObjectSafe(..)
+ | ty::PredicateAtom::ClosureKind(..)
+ | ty::PredicateAtom::RegionOutlives(..)
+ | ty::PredicateAtom::ConstEvaluatable(..)
+ | ty::PredicateAtom::ConstEquate(..) => None,
+ ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ref t, ref r)) => {
// Search for a bound of the form `erased_self_ty
// : 'a`, but be wary of something like `for<'a>
// erased_self_ty : 'a` (we interpret a
// it's kind of a moot point since you could never
// construct such an object, but this seems
// correct even if that code changes).
- let ty::OutlivesPredicate(ref t, ref r) = predicate.skip_binder();
if t == &erased_self_ty && !r.has_escaping_bound_vars() {
Some(*r)
} else {