[−][src]Struct rustc_mir_build::build::scope::Scope
Fields
source_scope: SourceScopeThe source scope this scope was created in.
region_scope: Scopethe region span of this scope within source code.
region_scope_span: Spanthe span of that region_scope
drops: Vec<DropData>set of places to drop when exiting this scope. This starts out empty but grows as variables are declared during the building process. This is a stack, so we always drop from the end of the vector (top of the stack) first.
moved_locals: Vec<Local>cached_exits: FxHashMap<(BasicBlock, Scope), BasicBlock>The cache for drop chain on “normal” exit into a particular BasicBlock.
cached_generator_drop: Option<BasicBlock>The cache for drop chain on "generator drop" exit.
cached_unwind: CachedBlockThe cache for drop chain on "unwind" exit.
Implementations
impl Scope[src]
fn invalidate_cache(
&mut self,
storage_only: bool,
generator_kind: Option<GeneratorKind>,
this_scope_only: bool
)[src]
&mut self,
storage_only: bool,
generator_kind: Option<GeneratorKind>,
this_scope_only: bool
)
Invalidates all the cached blocks in the scope.
Should always be run for all inner scopes when a drop is pushed into some scope enclosing a larger extent of code.
storage_only controls whether to invalidate only drop paths that run StorageDead.
this_scope_only controls whether to invalidate only drop paths that refer to the current
top-of-scope (as opposed to dependent scopes).
fn source_info(&self, span: Span) -> SourceInfo[src]
Given a span and this scope's source scope, make a SourceInfo.
fn needs_cleanup(&self) -> bool[src]
Whether there's anything to do for the cleanup path, that is, when unwinding through this scope. This includes destructors, but not StorageDead statements, which don't get emitted at all for unwinding, for several reasons:
- clang doesn't emit llvm.lifetime.end for C++ unwinding
- LLVM's memory dependency analysis can't handle it atm
- polluting the cleanup MIR with StorageDead creates landing pads even though there's no actual destructors
- freeing up stack space has no effect during unwinding Note that for generators we do emit StorageDeads, for the use of optimizations in the MIR generator transform.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,