pub(crate) fn live_args_for_alias_from_outlives_bounds<'tcx>(
tcx: TyCtxt<'tcx>,
kind: AliasTyKind<'tcx>,
) -> Option<EarlyBinder<'tcx, Vec<GenericArg<'tcx>>>>Expand description
For a given alias type, this returns the set of (identity) generic args that are relevant for liveness, that can be inferred from outlives bounds on the alias itself, and the explicit and implicit outlives clauses of the alias. Callers should instantiate the returned args with the concrete args of the alias.
There are three cases to consider:
- If there are no outlives bounds, then we return None.
- If there is a
'staticoutlives bound, then we know that all args are irrelevant, so we return an empty list. - If there are any outlives bounds, then we find any args that are known to outlive those bounds, since those are the args whose regions the underlying type could capture.