Trait rustc_typeck::check::regionck::OutlivesEnvironmentExt
source · [−]pub(crate) trait OutlivesEnvironmentExt<'tcx> {
fn add_implied_bounds(
&mut self,
infcx: &InferCtxt<'_, 'tcx>,
fn_sig_tys: FxHashSet<Ty<'tcx>>,
body_id: HirId
);
}Required Methods
fn add_implied_bounds(
&mut self,
infcx: &InferCtxt<'_, 'tcx>,
fn_sig_tys: FxHashSet<Ty<'tcx>>,
body_id: HirId
)
Implementations on Foreign Types
sourceimpl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx>
impl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx>
sourcefn add_implied_bounds<'a>(
&mut self,
infcx: &InferCtxt<'a, 'tcx>,
fn_sig_tys: FxHashSet<Ty<'tcx>>,
body_id: HirId
)
fn add_implied_bounds<'a>(
&mut self,
infcx: &InferCtxt<'a, 'tcx>,
fn_sig_tys: FxHashSet<Ty<'tcx>>,
body_id: HirId
)
This method adds “implied bounds” into the outlives environment. Implied bounds are outlives relationships that we can deduce on the basis that certain types must be well-formed – these are either the types that appear in the function signature or else the input types to an impl. For example, if you have a function like
fn foo<'a, 'b, T>(x: &'a &'b [T]) { }we can assume in the caller’s body that 'b: 'a and that T: 'b (and hence, transitively, that T: 'a). This method would
add those assumptions into the outlives-environment.
Tests: src/test/ui/regions/regions-free-region-ordering-*.rs