pub fn object_region_bounds<'a, 'gcx, 'tcx>(
    tcx: TyCtxt<'a, 'gcx, 'tcx>,
    existential_predicates: ty::Binder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>)
    -> Vec<ty::Region<'tcx>>
{
    // Since we don't actually *know* the self type for an object,
    // this "open(err)" serves as a kind of dummy standin -- basically
    // a skolemized type.
    let open_ty = tcx.mk_infer(ty::FreshTy(0));

    let predicates = existential_predicates.iter().filter_map(|predicate| {
        if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
            None
        } else {
            Some(predicate.with_self_ty(tcx, open_ty))
        }
    }).collect();

    tcx.required_region_bounds(open_ty, predicates)
}
/// Given an object type like `SomeTrait+Send`, computes the lifetime
/// bounds that must hold on the elided self type. These are derived
/// from the declarations of `SomeTrait`, `Send`, and friends -- if
/// they declare `trait SomeTrait : 'static`, for example, then
/// `'static` would appear in the list. The hard work is done by
/// `ty::required_region_bounds`, see that for more information.
Given an object type like `SomeTrait+Send`, computes the lifetime
bounds that must hold on the elided self type.
Given an object type like ` SomeTrait + Send ` computes the lifetime bounds that must hold on the elided self type .
pub fn object_region_bounds<'a, 'gcx, 'tcx>(
    tcx: TyCtxt<'a, 'gcx, 'tcx>,
    existential_predicates: ty::Binder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>)
    -> Vec<ty::Region<'tcx>>
{
    // Since we don't actually *know* the self type for an object,
    // this "open(err)" serves as a kind of dummy standin -- basically
    // a skolemized type.
    let open_ty = tcx.mk_infer(ty::FreshTy(0));
    let predicates = existential_predicates.iter().filter_map(|predicate| {
        if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
            None
        } else {
            Some(predicate.with_self_ty(tcx, open_ty))
        }
    }).collect();
    tcx.required_region_bounds(open_ty, predicates)
}
pub fn object_region_bounds < ' a , ' gcx , ' tcx > ( tcx : TyCtxt < ' a , ' gcx , ' tcx > , existential_predicates : ty :: Binder < & ' tcx ty :: Slice < ty :: ExistentialPredicate < ' tcx > > > ) -> Vec < ty :: Region < ' tcx > > { // Since we don't actually *know* the self type for an object, // this "open(err)" serves as a kind of dummy standin -- basically // a skolemized type. let open_ty = tcx . mk_infer ( ty :: FreshTy ( 0 ) ) ; let predicates = existential_predicates . iter ( ) . filter_map ( | predicate | { if let ty :: ExistentialPredicate :: Projection ( _ ) = * predicate . skip_binder ( ) { None } else { Some ( predicate . with_self_ty ( tcx , open_ty ) ) } } ) . collect ( ) ; tcx . required_region_bounds ( open_ty , predicates ) }
Given an object type like `SomeTrait+Send`, computes the lifetime
bounds that must hold on the elided self type.
Given an object type like ` SomeTrait + Send ` computes the lifetime bounds that must hold on the elided self type .
tcx
TyCtxt<'a, 'gcx, 'tcx>
existential_predicates
ty::Binder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>
tcx
TyCtxt<'a, 'gcx, 'tcx>
existential_predicates
ty::Binder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>