pub struct ScopeBlockTraversal {
pub block_infos: HashMap<BlockId, ScopeBlockInfo>,
/* private fields */
}Expand description
Helper struct for traversing scope blocks in HIR-form.
Equivalent to TS ScopeBlockTraversal class.
Fields§
§block_infos: HashMap<BlockId, ScopeBlockInfo>Map from block ID to scope block info
Implementations§
Source§impl ScopeBlockTraversal
impl ScopeBlockTraversal
pub fn new() -> Self
Sourcepub fn record_scopes(&mut self, block: &BasicBlock)
pub fn record_scopes(&mut self, block: &BasicBlock)
Record scope information for a block’s terminal.
Equivalent to TS recordScopes.
Sourcepub fn is_scope_active(&self, scope_id: ScopeId) -> bool
pub fn is_scope_active(&self, scope_id: ScopeId) -> bool
Returns true if the given scope is currently ‘active’, i.e. if the scope start block but not the scope fallthrough has been recorded.
Sourcepub fn current_scope(&self) -> Option<ScopeId>
pub fn current_scope(&self) -> Option<ScopeId>
The current, innermost active scope.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopeBlockTraversal
impl RefUnwindSafe for ScopeBlockTraversal
impl Send for ScopeBlockTraversal
impl Sync for ScopeBlockTraversal
impl Unpin for ScopeBlockTraversal
impl UnsafeUnpin for ScopeBlockTraversal
impl UnwindSafe for ScopeBlockTraversal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more