[][src]Struct rustc::ty::inhabitedness::DefIdForest

pub struct DefIdForest {
    root_ids: SmallVec<[DefId; 1]>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Represents a forest of DefIds closed under the ancestor relation. That is, if a DefId representing a module is contained in the forest then all DefIds defined in that module or submodules are also implicitly contained in the forest.

This is used to represent a set of modules in which a type is visibly uninhabited.

Fields

root_ids: SmallVec<[DefId; 1]>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The minimal set of DefIds required to represent the whole set. If A and B are DefIds in the DefIdForest, and A is a descendant of B, then only B will be in root_ids. We use a SmallVec here because (for its use for caching inhabitedness) its rare that this will contain even two IDs.

Methods

impl<'tcx> DefIdForest[src]

pub fn empty() -> DefIdForest[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates an empty forest.

pub fn full(tcx: TyCtxt<'tcx>) -> DefIdForest[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a forest consisting of a single tree representing the entire crate.

pub fn from_id(id: DefId) -> DefIdForest[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a forest containing a DefId and all its descendants.

pub fn is_empty(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Tests whether the forest is empty.

pub fn contains(&self, tcx: TyCtxt<'tcx>, id: DefId) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Tests whether the forest contains a given DefId.

pub fn intersection<I>(tcx: TyCtxt<'tcx>, iter: I) -> DefIdForest where
    I: IntoIterator<Item = DefIdForest>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Calculate the intersection of a collection of forests.

pub fn union<I>(tcx: TyCtxt<'tcx>, iter: I) -> DefIdForest where
    I: IntoIterator<Item = DefIdForest>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Calculate the union of a collection of forests.

Trait Implementations

impl Clone for DefIdForest[src]

Auto Trait Implementations

impl RefUnwindSafe for DefIdForest

impl Send for DefIdForest

impl Sync for DefIdForest

impl Unpin for DefIdForest

impl UnwindSafe for DefIdForest

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]