1 //! Various code related to computing outlives relations.
7 use rustc::traits::query::OutlivesBound;
10 pub fn explicit_outlives_bounds<'tcx>(
11 param_env: ty::ParamEnv<'tcx>,
12 ) -> impl Iterator<Item = OutlivesBound<'tcx>> + 'tcx {
13 debug!("explicit_outlives_bounds()");
14 param_env.caller_bounds.into_iter().filter_map(move |predicate| match predicate {
15 ty::Predicate::Projection(..)
16 | ty::Predicate::Trait(..)
17 | ty::Predicate::Subtype(..)
18 | ty::Predicate::WellFormed(..)
19 | ty::Predicate::ObjectSafe(..)
20 | ty::Predicate::ClosureKind(..)
21 | ty::Predicate::TypeOutlives(..)
22 | ty::Predicate::ConstEvaluatable(..) => None,
23 ty::Predicate::RegionOutlives(ref data) => data
25 .map(|ty::OutlivesPredicate(r_a, r_b)| OutlivesBound::RegionSubRegion(r_b, r_a)),