Skip to main content

Module region

Module region 

Source
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 at index.
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: 'b bounds and their transitive closure. sub_free_regions(r_a, r_b) tests r_a <= r_b (i.e. r_b: r_a), so src: ret is sub_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 to ReErased).
region_outlives ๐Ÿ”’
Whether src outlives ret (src: ret).
region_outlives_implied ๐Ÿ”’
Whether src_region provably outlives demand via 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-only region_outlives cannot see. This holds when demand is exactly the referenceโ€™s own region 'r and src_region is one of the pointeeโ€™s outlives components.