Skip to main content

Region

Type Alias Region 

Source
pub type Region<'tcx> = Region<TyCtxt<'tcx>>;

Aliased Type§

pub struct Region<'tcx>(pub Interned<'tcx, RegionKind<TyCtxt<'tcx>>>);

Tuple Fields§

§0: Interned<'tcx, RegionKind<TyCtxt<'tcx>>>

Trait Implementations§

Source§

impl<'tcx, P: Printer<'tcx>> Print<P> for Region<'tcx>

Source§

impl<'tcx> RegionExt<'tcx> for Region<'tcx>

Source§

fn new_error(tcx: TyCtxt<'tcx>, guar: ErrorGuaranteed) -> Region<'tcx>

Constructs a RegionKind::ReError region.

Source§

fn new_error_misc(tcx: TyCtxt<'tcx>) -> Region<'tcx>

Constructs a RegionKind::ReError region and registers a delayed bug to ensure it gets used.

Source§

fn new_error_with_message<S: Into<MultiSpan>>( tcx: TyCtxt<'tcx>, span: S, msg: &'static str, ) -> Region<'tcx>

Constructs a RegionKind::ReError region and registers a delayed bug with the given msg to ensure it gets used.

Source§

fn new_from_kind(tcx: TyCtxt<'tcx>, kind: RegionKind<'tcx>) -> Region<'tcx>

Avoid this in favour of more specific new_* methods, where possible, to avoid the cost of the match.

Source§

fn new_early_param( tcx: TyCtxt<'tcx>, early_bound_region: EarlyParamRegion, ) -> Region<'tcx>

Source§

fn new_late_param( tcx: TyCtxt<'tcx>, scope: DefId, kind: LateParamRegionKind, ) -> Region<'tcx>

Source§

fn new_var(tcx: TyCtxt<'tcx>, v: RegionVid) -> Region<'tcx>

Source§

impl<'tcx> RegionUtilitiesExt<'tcx> for Region<'tcx>

Source§

fn is_named(self, tcx: TyCtxt<'tcx>) -> bool

Is this region named by the user?

Source§

fn is_param(self) -> bool

True for free regions other than 'static.

Source§

fn is_free(self) -> bool

True for free region in the current context.

This is the case for 'static and param regions.

Source§

fn opt_param_def_id( self, tcx: TyCtxt<'tcx>, binding_item: DefId, ) -> Option<DefId>

Given some item binding_item, check if this region is a generic parameter introduced by it or one of the parent generics. Returns the DefId of the parameter definition if so.

Source§

fn get_name(self, tcx: TyCtxt<'tcx>) -> Option<Symbol>

Source§

fn get_name_or_anon(self, tcx: TyCtxt<'tcx>) -> Symbol

Source§

fn is_error(self) -> bool

Source§

fn is_static(self) -> bool

Source§

fn is_erased(self) -> bool

Source§

fn is_placeholder(self) -> bool

Source§

fn bound_at_or_above_binder(self, index: DebruijnIndex) -> bool

Source§

fn is_var(self) -> bool

Source§

fn as_var(self) -> RegionVid

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 8 bytes