pub enum Node<'tcx> {
Analyzed {
call_sites: Vec<CallSite<'tcx>>,
},
ExternalCrate,
Leaf(DefKind),
}Expand description
A node in the call graph. The node’s provenance (source item vs monomorphization) is carried by
its NodeKey; the node itself only records, when it has an analyzable body, the call sites
observed in it.
Variants§
Analyzed
MIR was available and walked. call_sites are the Call/Assert terminators observed.
ExternalCrate
External crate function — panic spec looked up from crate metadata.
Leaf(DefKind)
Function with no analyzable body (no Rust body by design, MIR unavailable,
or a non-Item instance such as a shim or virtual dispatch stub).
Conservatively treated as MightPanic.
Implementations§
Source§impl<'tcx> Node<'tcx>
impl<'tcx> Node<'tcx>
Sourcefn call_sites(&self) -> &[CallSite<'tcx>]
fn call_sites(&self) -> &[CallSite<'tcx>]
Call sites observed in this node’s body. Empty for non-Analyzed nodes.
Sourcepub fn resolved_callees(&self) -> impl Iterator<Item = NodeKey<'tcx>>
pub fn resolved_callees(&self) -> impl Iterator<Item = NodeKey<'tcx>>
The callee nodes of this node’s resolved call sites (skipping unresolved/dynamic ones).
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> Freeze for Node<'tcx>
impl<'tcx> !RefUnwindSafe for Node<'tcx>
impl<'tcx> Send for Node<'tcx>
impl<'tcx> Sync for Node<'tcx>
impl<'tcx> Unpin for Node<'tcx>
impl<'tcx> !UnwindSafe for Node<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more