Struct rustc::traits::specialize::specialization_graph::Graph [−][src]
🔬 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?
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, which 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>
🔬 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?
children: DefIdMap<Children>
🔬 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?
Methods
impl<'a, 'gcx, 'tcx> Graph
[src]
impl<'a, 'gcx, 'tcx> Graph
pub fn new() -> Graph
[src]
pub fn new() -> Graph
🔬 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?
pub fn insert(
&mut self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
impl_def_id: DefId
) -> Result<Option<OverlapError>, OverlapError>
[src]
pub fn insert(
&mut self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
impl_def_id: DefId
) -> Result<Option<OverlapError>, OverlapError>
🔬 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?
Insert a local impl into the specialization graph. If an existing impl
conflicts with it (has overlap, but neither specializes the other),
information about the area of overlap is returned in the Err
.
pub fn record_impl_from_cstore(
&mut self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
parent: DefId,
child: DefId
)
[src]
pub fn record_impl_from_cstore(
&mut self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
parent: DefId,
child: DefId
)
🔬 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?
Insert cached metadata mapping from a child impl back to its parent.
pub fn parent(&self, child: DefId) -> DefId
[src]
pub fn parent(&self, child: DefId) -> DefId
🔬 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?
The parent of a given impl, which is the def id of the trait when the impl is a "specialization root".
Trait Implementations
impl Encodable for Graph
[src]
impl Encodable for Graph
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 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?
impl Decodable for Graph
[src]
impl Decodable for Graph
fn decode<__D: Decoder>(d: &mut __D) -> Result<Graph, __D::Error>
[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Graph, __D::Error>
🔬 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?
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Graph
[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Graph
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)
🔬 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?