[−][src]Struct rustc_middle::ty::inhabitedness::DefIdForest
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]>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.
Implementations
impl<'tcx> DefIdForest[src]
pub fn empty() -> DefIdForest[src]
Creates an empty forest.
pub fn full(tcx: TyCtxt<'tcx>) -> DefIdForest[src]
Creates a forest consisting of a single tree representing the entire crate.
pub fn from_id(id: DefId) -> DefIdForest[src]
Creates a forest containing a DefId and all its descendants.
pub fn is_empty(&self) -> bool[src]
Tests whether the forest is empty.
pub fn contains(&self, tcx: TyCtxt<'tcx>, id: DefId) -> bool[src]
Tests whether the forest contains a given DefId.
pub fn intersection<I>(tcx: TyCtxt<'tcx>, iter: I) -> DefIdForest where
I: IntoIterator<Item = DefIdForest>, [src]
I: IntoIterator<Item = DefIdForest>,
Calculate the intersection of a collection of forests.
pub fn union<I>(tcx: TyCtxt<'tcx>, iter: I) -> DefIdForest where
I: IntoIterator<Item = DefIdForest>, [src]
I: IntoIterator<Item = DefIdForest>,
Calculate the union of a collection of forests.
Trait Implementations
impl Clone for DefIdForest[src]
pub fn clone(&self) -> DefIdForest[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> MaybeResult<T> for T[src]
type Error = !
pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]
pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.