Struct rustc_mir::build::scope::Scope [−][src]
pub struct Scope<'tcx> { visibility_scope: VisibilityScope, region_scope: Scope, region_scope_span: Span, needs_cleanup: bool, drops: Vec<DropData<'tcx>>, cached_exits: FxHashMap<(BasicBlock, Scope), BasicBlock>, cached_generator_drop: Option<BasicBlock>, cached_unwind: CachedBlock, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
visibility_scope: VisibilityScope
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The visibility scope this scope was created in.
region_scope: Scope
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
the region span of this scope within source code.
region_scope_span: Span
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
the span of that region_scope
needs_cleanup: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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
drops: Vec<DropData<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
cached_exits: FxHashMap<(BasicBlock, Scope), BasicBlock>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The cache for drop chain on “normal” exit into a particular BasicBlock.
cached_generator_drop: Option<BasicBlock>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The cache for drop chain on "generator drop" exit.
cached_unwind: CachedBlock
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The cache for drop chain on "unwind" exit.
Methods
impl<'tcx> Scope<'tcx>
[src]
impl<'tcx> Scope<'tcx>
fn invalidate_cache(&mut self, storage_only: bool, this_scope_only: bool)
[src]
fn invalidate_cache(&mut self, storage_only: bool, this_scope_only: bool)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Invalidate 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 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]
fn source_info(&self, span: Span) -> SourceInfo
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Given a span and this scope's visibility scope, make a SourceInfo.