Expand description
Region (lifetime) helpers shared by the VM and the property checker.
Re-exportsยง
use rustc_data_structures::fx::FxHashSet;๐use rustc_data_structures::smallvec::SmallVec;๐use rustc_hir::def::DefKind;๐use rustc_hir::def_id::DefId;๐use rustc_infer::infer::outlives::env::OutlivesEnvironment;๐use rustc_middle::ty::Region;๐use rustc_middle::ty::RegionKind;๐use rustc_middle::ty::Ty;๐use rustc_middle::ty::TyCtxt;๐use rustc_middle::ty::TyKind;๐use rustc_middle::ty::outlives::Component;๐use rustc_middle::ty::outlives::push_outlives_components;๐
Functionsยง
- fn_
arg_ ๐ty - The type of
def_idโs argument atindex. - fn_
return_ ๐region - The reference region of
def_idโs return type (&'r TโSome('r)). - free_
region_ ๐outlives - Consult the functionโs declared outlives constraints (where-clauses) via
rustcโs
FreeRegionMap, which records'a: 'bbounds and their transitive closure.sub_free_regions(r_a, r_b)testsr_a <= r_b(i.e.r_b: r_a), sosrc: retissub_free_regions(ret, src). - liberate_
fn_ ๐sig - The functionโs signature with late-bound regions liberated to free
ReLateParams, so reference regions are comparable (MIR erases them toReErased). - region_
outlives ๐ - Whether
srcoutlivesret(src: ret). - region_
outlives_ ๐implied - Whether
src_regionprovably outlivesdemandvia the well-formedness of a reference parameter&'r Self<'a>: the reference requires its pointeeโs regions to outlive'r('a: 'r), which the where-clause-onlyregion_outlivescannot see. This holds whendemandis exactly the referenceโs own region'randsrc_regionis one of the pointeeโs outlives components.