Skip to content

Commit

Permalink
Unnest some .chain calls, so it's clearer what's going on.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Dec 4, 2020
1 parent cb56b1a commit 4d8a7c2
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions compiler/rustc_typeck/src/bounds.rs
Expand Up @@ -67,22 +67,18 @@ impl<'tcx> Bounds<'tcx> {

sized_predicate
.into_iter()
.chain(self.region_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.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()
}
Expand Down

0 comments on commit 4d8a7c2

Please sign in to comment.