[−][src]Struct rustc_passes::region::RegionResolutionVisitor

pub(in region) struct RegionResolutionVisitor<'tcx> {
    tcx: TyCtxt<'tcx>,
    expr_and_pat_count: usize,
    pessimistic_yield: bool,
    fixup_scopes: Vec<Scope>,
    scope_tree: ScopeTree,
    cx: Context,
    terminating_scopes: FxHashSet<ItemLocalId>,
}

Fields

tcx: TyCtxt<'tcx>expr_and_pat_count: usizepessimistic_yield: boolfixup_scopes: Vec<Scope>scope_tree: ScopeTreecx: Contextterminating_scopes: FxHashSet<ItemLocalId>

terminating_scopes is a set containing the ids of each statement, or conditional/repeating expression. These scopes are calling "terminating scopes" because, when attempting to find the scope of a temporary, by default we search up the enclosing scopes until we encounter the terminating scope. A conditional/repeating expression is one which is not guaranteed to execute exactly once upon entering the parent scope. This could be because the expression only executes conditionally, such as the expression b in a && b, or because the expression may execute many times, such as a loop body. The reason that we distinguish such expressions is that, upon exiting the parent scope, we cannot statically know how many times the expression executed, and thus if the expression creates temporaries we cannot know statically how many such temporaries we would have to cleanup. Therefore, we ensure that the temporaries never outlast the conditional/repeating expression, preventing the need for dynamic checks and/or arbitrary amounts of stack space. Terminating scopes end up being contained in a DestructionScope that contains the destructor's execution.

Implementations

impl<'tcx> RegionResolutionVisitor<'tcx>[src]

pub(in region) fn record_child_scope(
    &mut self,
    child_scope: Scope
) -> ScopeDepth
[src]

Records the current parent (if any) as the parent of child_scope. Returns the depth of child_scope.

pub(in region) fn enter_scope(
    &mut self,
    child_scope: Scope
)
[src]

Records the current parent (if any) as the parent of child_scope, and sets child_scope as the new current parent.

pub(in region) fn enter_node_scope_with_dtor(
    &mut self,
    id: ItemLocalId
)
[src]

Trait Implementations

impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx>[src]

type Map = ErasedMap<'tcx>

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for RegionResolutionVisitor<'tcx>

impl<'tcx> !Send for RegionResolutionVisitor<'tcx>

impl<'tcx> !Sync for RegionResolutionVisitor<'tcx>

impl<'tcx> Unpin for RegionResolutionVisitor<'tcx>

impl<'tcx> !UnwindSafe for RegionResolutionVisitor<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.