/// When we have an implied bound that `T: 'a`, we can further break
/// this down to determine what relationships would have to hold for
/// `T: 'a` to hold. We get to assume that the caller has validated
/// those relationships.
When we have an implied bound that `T: 'a`, we can further break
this down to determine what relationships would have to hold for
`T: 'a` to hold. We get to assume that the caller has validated
those relationships.
When we have an implied bound that ` T : ' a ` we can further break this down to determine what relationships would have to hold for ` T : ' a ` to hold . We get to assume that the caller has validated those relationships .
fn implied_bounds_from_components(
    sub_region: ty::Region<'tcx>,
    sup_components: SmallVec<[Component<'tcx>; 4]>,
) -> Vec<OutlivesBound<'tcx>> {
    sup_components
        .into_iter()
        .filter_map(|component| {
            match component {
                Component::Region(r) => Some(OutlivesBound::RegionSubRegion(sub_region, r)),
                Component::Param(p) => Some(OutlivesBound::RegionSubParam(sub_region, p)),
                Component::Projection(p) => Some(OutlivesBound::RegionSubProjection(sub_region, p)),
                Component::EscapingProjection(_) =>
                // If the projection has escaping regions, don't
                // try to infer any implied bounds even for its
                // free components. This is conservative, because
                // the caller will still have to prove that those
                // free components outlive `sub_region`. But the
                // idea is that the WAY that the caller proves
                // that may change in the future and we want to
                // give ourselves room to get smarter here.
                {
                    None
                }
                Component::UnresolvedInferenceVariable(..) => None,
            }
        })
        .collect()
}
fn implied_bounds_from_components ( sub_region : ty :: Region < ' tcx > , sup_components : SmallVec < [ Component < ' tcx > ; 4 ] > , ) -> Vec < OutlivesBound < ' tcx > > { sup_components . into_iter ( ) . filter_map ( | component | { match component { Component :: Region ( r ) => Some ( OutlivesBound :: RegionSubRegion ( sub_region , r ) ) , Component :: Param ( p ) => Some ( OutlivesBound :: RegionSubParam ( sub_region , p ) ) , Component :: Projection ( p ) => Some ( OutlivesBound :: RegionSubProjection ( sub_region , p ) ) , Component :: EscapingProjection ( _ ) => // If the projection has escaping regions, don't // try to infer any implied bounds even for its // free components. This is conservative, because // the caller will still have to prove that those // free components outlive `sub_region`. But the // idea is that the WAY that the caller proves // that may change in the future and we want to // give ourselves room to get smarter here. { None } Component :: UnresolvedInferenceVariable ( .. ) => None , } } ) . collect ( ) }
When we have an implied bound that `T: 'a`, we can further break
this down to determine what relationships would have to hold for
`T: 'a` to hold.
When we have an implied bound that ` T : ' a ` we can further break this down to determine what relationships would have to hold for ` T : ' a ` to hold .
sub_region
ty::Region<'tcx>
sup_components
SmallVec<[Component<'tcx>; 4]>