/// A list of region bounds on the (implicit) self type. So if you
/// had `T: 'a + 'b` this might would be a list `['a, 'b]` (but
/// the `T` is not explicitly included).
- pub region_bounds: Vec<(ty::Region<'tcx>, Span)>,
+ pub region_bounds: Vec<(ty::Binder<ty::Region<'tcx>>, Span)>,
/// A list of trait bounds. So if you had `T: Debug` this would be
/// `T: Debug`. Note that the self-type is explicit here.
sized_predicate
.into_iter()
+ .chain(self.region_bounds.iter().map(|&(region_bound, span)| {
+ (
+ region_bound
+ .map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound))
+ .to_predicate(tcx),
+ span,
+ )
+ }))
+ .chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
+ let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);
+ (predicate, span)
+ }))
.chain(
- self.region_bounds
+ self.projection_bounds
.iter()
- .map(|&(region_bound, span)| {
- let outlives = ty::OutlivesPredicate(param_ty, region_bound);
- (ty::Binder::bind(outlives).to_predicate(tcx), span)
- })
- .chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
- let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);
- (predicate, span)
- }))
- .chain(
- self.projection_bounds
- .iter()
- .map(|&(projection, span)| (projection.to_predicate(tcx), span)),
- ),
+ .map(|&(projection, span)| (projection.to_predicate(tcx), span)),
)
.collect()
}