[−][src]Module rustc_mir::util::liveness
🔬 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?
Liveness analysis which computes liveness of MIR local variables at the boundary of basic blocks
This analysis considers references as being used only at the point of the borrow. This means that this does not track uses because of references that already exist:
fn foo() {
x = 0;
// `x` is live here
GLOBAL = &x: *const u32;
// but not here, even while it can be accessed through `GLOBAL`.
foo();
x = 1;
// `x` is live again here, because it is assigned to `OTHER_GLOBAL`
OTHER_GLOBAL = &x: *const u32;
// ...
}
This means that users of this analysis still have to check whether pre-existing references can be used to access the value (e.g. at movable generator yield points, all pre-existing references are invalidated, so this doesn't matter).
Structs
DefsUses |
[ Experimental ]
|
DefsUsesVisitor |
[ Experimental ]
|
IdentityMap |
[ Experimental ]
|
LivenessResult |
[ Experimental ] This gives the result of the liveness analysis at the boundary of basic blocks. |
Enums
DefUse |
[ Experimental ]
|
Traits
LiveVariableMap |
[ Experimental ] Defines the mapping to/from the MIR local variables ( |
Functions
block |
[ Experimental ]
|
categorize |
[ Experimental ]
|
dump_matched_mir_node |
[ Experimental ]
|
dump_mir |
[ Experimental ]
|
liveness_of_locals |
[ Experimental ] Compute which local variables are live within the given function
|
write_mir_fn |
[ Experimental ]
|
Type Definitions
LiveVarSet |
[ Experimental ]
|