[−][src]Struct rustc_trait_selection::traits::TraitAliasExpander

pub struct TraitAliasExpander<'tcx> {
    tcx: TyCtxt<'tcx>,
    stack: Vec<TraitAliasExpansionInfo<'tcx>>,
}

"Trait alias expansion" is the process of expanding a sequence of trait references into another sequence by transitively following all trait aliases. e.g. If you have bounds like Foo + Send, a trait alias trait Foo = Bar + Sync;, and another trait alias trait Bar = Read + Write, then the bounds would expand to Read + Write + Sync + Send. Expansion is done via a DFS (depth-first search), and the visited field is used to avoid cycles.

Fields

tcx: TyCtxt<'tcx>stack: Vec<TraitAliasExpansionInfo<'tcx>>

Implementations

impl<'tcx> TraitAliasExpander<'tcx>[src]

pub(in traits::util) fn expand(
    &mut self,
    item: &TraitAliasExpansionInfo<'tcx>
) -> bool
[src]

If item is a trait alias and its predicate has not yet been visited, then expands item to the definition, pushes the resulting expansion onto self.stack, and returns false. Otherwise, immediately returns true if item is a regular trait, or false if it is a trait alias. The return value indicates whether item should be yielded to the user.

Trait Implementations

impl<'tcx> Iterator for TraitAliasExpander<'tcx>[src]

type Item = TraitAliasExpansionInfo<'tcx>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for TraitAliasExpander<'tcx>

impl<'tcx> !Send for TraitAliasExpander<'tcx>

impl<'tcx> !Sync for TraitAliasExpander<'tcx>

impl<'tcx> Unpin for TraitAliasExpander<'tcx>

impl<'tcx> !UnwindSafe for TraitAliasExpander<'tcx>

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<T> From<T> for T[src]

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

impl<I> IntoIterator for I where
    I: Iterator, 
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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]