struct Held {
srcs: HashMap<Root, Src>,
origin: HashMap<Root, DefId>,
selves: HashSet<Local>,
nested: bool,
coroutine: bool,
}Expand description
What the values of one body hold, as Srcs.
In a function, Param(k) is its parameter k. In a closure or coroutine, it is the captured
value k, which is what the body that creates it passes (Analyzer::local records the
captures as the edge’s sources); its own parameters (the closure or Pin<&mut Self>, the
context, a closure’s arguments) are unknown.
A parameter or capture is followed only if it is never assigned or borrowed mutably. A local
or slot is followed only if it is assigned once, from a copy, move or shared borrow of a
followed value (through *), a string constant, or a SAME_VALUE call of the standard
library on one. Everything else is Unknown.
Fields§
§srcs: HashMap<Root, Src>§origin: HashMap<Root, DefId>The local function whose call produced the value (a future returned by an async fn),
followed through moves, borrows, into_future and Pin::new_unchecked.
selves: HashSet<Local>Locals that hold the closure or coroutine itself (_7 = copy (_1.0) of Pin<&mut _>).
nested: bool§coroutine: boolImplementations§
Source§impl Held
impl Held
fn new<'tcx>( tcx: TyCtxt<'tcx>, def_id: DefId, body: &Body<'tcx>, constant: impl Fn(&Operand<'tcx>) -> Option<String>, ) -> Self
Sourcefn root(&self, p: &Place<'_>) -> Option<Root>
fn root(&self, p: &Place<'_>) -> Option<Root>
The root a place’s value is read from: a local through *, a capture or a slot of the
coroutine through *. None for anything else (a field of a local, an index).
Sourcefn target_root(&self, p: &Place<'_>) -> Option<Root>
fn target_root(&self, p: &Place<'_>) -> Option<Root>
The root an assignment to p defines (a whole local or slot) or changes (a capture).
Sourcefn base(&self, p: &Place<'_>) -> Root
fn base(&self, p: &Place<'_>) -> Root
The root whose value a write to p may change: its capture or slot, or its local.