Struct rustc_middle::traits::specialization_graph::Graph
source · pub struct Graph {
pub parent: DefIdMap<DefId>,
pub children: DefIdMap<Children>,
pub has_errored: Option<ErrorGuaranteed>,
}
Expand description
A per-trait graph of impls in specialization order. At the moment, this graph forms a tree rooted with the trait itself, with all other nodes representing impls, and parent-child relationships representing specializations.
The graph provides two key services:
-
Construction. This implicitly checks for overlapping impls (i.e., impls that overlap but where neither specializes the other – an artifact of the simple “chain” rule.
-
Parent extraction. In particular, the graph can give you the immediate parents of a given specializing impl, which is needed for extracting default items amongst other things. In the simple “chain” rule, every impl has at most one parent.
Fields§
§parent: DefIdMap<DefId>
All impls have a parent; the “root” impls have as their parent the def_id
of the trait.
children: DefIdMap<Children>
The “root” impls are found by looking up the trait’s def_id.
has_errored: Option<ErrorGuaranteed>
Whether an error was emitted while constructing the graph.
Implementations§
Trait Implementations§
source§impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for Graph
impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for Graph
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
Auto Trait Implementations§
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
source§impl<Tcx, T> DepNodeParams<Tcx> for Twhere
Tcx: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Tcx, T> DepNodeParams<Tcx> for Twhere
Tcx: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
default fn fingerprint_style() -> FingerprintStyle
source§default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_debug_str(&self, _: Tcx) -> String
source§default fn recover(
_: Tcx,
_: &DepNode<<Tcx as DepContext>::DepKind>
) -> Option<T>
default fn recover(
_: Tcx,
_: &DepNode<<Tcx as DepContext>::DepKind>
) -> Option<T>
DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read moresource§impl<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(iter: I, f: F) -> <T as InternIteratorElement<T, R>>::Outputwhere
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo]) -> T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes