pub enum NodeKey<'tcx> {
Item(DefId),
Mono(Instance<'tcx>),
}Expand description
Identity of a call-graph node. Distinguishes an item as defined in source from a monomorphization synthesized while building the graph.
Variants§
Item(DefId)
An item as written in source (generic or not), identified by its DefId.
Mono(Instance<'tcx>)
A generic item monomorphized at concrete type/const args while building the
call graph (e.g. Vec::<i32>::push). We must guarantee that the instance is fully
monomorphic, i.e., the Instance’s args are all concrete types/consts.
Use NodeKey::from_instance to classify an Instance into a NodeKey.
Implementations§
Source§impl<'tcx> NodeKey<'tcx>
impl<'tcx> NodeKey<'tcx>
Sourcepub fn from_instance(instance: Instance<'tcx>) -> Self
pub fn from_instance(instance: Instance<'tcx>) -> Self
Classifies an Instance into a NodeKey.
pub fn def_id(self) -> DefId
Sourcepub fn is_local_item(self) -> bool
pub fn is_local_item(self) -> bool
Whether this key denotes a locally-defined function item — the source item itself or a
monomorphization of it. Excludes foreign defs and non-Item instances (drop glue, fn-ptr
shims, etc.), which never carry a meaningful spec. Used to decide which specs a crate owns
and serializes into its own metadata.
Trait Implementations§
impl<'tcx> Copy for NodeKey<'tcx>
impl<'tcx> Eq for NodeKey<'tcx>
impl<'tcx> StructuralPartialEq for NodeKey<'tcx>
Auto Trait Implementations§
impl<'tcx> Freeze for NodeKey<'tcx>
impl<'tcx> !RefUnwindSafe for NodeKey<'tcx>
impl<'tcx> Send for NodeKey<'tcx>
impl<'tcx> Sync for NodeKey<'tcx>
impl<'tcx> Unpin for NodeKey<'tcx>
impl<'tcx> !UnwindSafe for NodeKey<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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>
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