Enum rustc_mir::build::LocalsForNode [−][src]
enum LocalsForNode { One(Local), ForGuard { vals_for_guard: Vec<Local>, ref_for_guard: Local, for_arm_body: Local, }, }
🔬 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?
Variants
One(Local)
🔬 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?
In the usual case, a node-id for an identifier maps to at most one Local declaration.
ForGuard
🔬 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 exceptional case is identifiers in a match arm's pattern
that are referenced in a guard of that match arm. For these,
we can have 2+k
Locals, where k
is the number of candidate
patterns (separated by |
) in the arm.
-
for_arm_body
is the Local used in the arm body (which is just like theOne
case above), -
ref_for_guard
is the Local used in the arm's guard (which is a reference to a temp that is an alias offor_arm_body
). -
vals_for_guard
is thek
Locals; at most one of them will get initialized by the arm's execution, and after it is initialized,ref_for_guard
will be assigned a reference to it.
There reason we have k
Locals rather than just 1 is to
accommodate some restrictions imposed by two-phase borrows,
which apply when we have a ref mut
pattern.
Fields of ForGuard
vals_for_guard: Vec<Local> | 🔬 This is a nightly-only experimental API. ( |
ref_for_guard: Local | 🔬 This is a nightly-only experimental API. ( |
for_arm_body: Local | 🔬 This is a nightly-only experimental API. ( |
Methods
impl LocalsForNode
[src]
impl LocalsForNode
fn local_id(&self, for_guard: ForGuard) -> Local
[src]
fn local_id(&self, for_guard: ForGuard) -> Local
🔬 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?
Trait Implementations
impl Debug for LocalsForNode
[src]
impl Debug for LocalsForNode
Auto Trait Implementations
impl Send for LocalsForNode
impl Send for LocalsForNode
impl Sync for LocalsForNode
impl Sync for LocalsForNode