pub enum SelectionError<'tcx> {
    Unimplemented,
    OutputTypeParameterMismatch(Binder<'tcx, TraitRef<'tcx>>, Binder<'tcx, TraitRef<'tcx>>, TypeError<'tcx>),
    TraitNotObjectSafe(DefId),
    NotConstEvaluatable(NotConstEvaluatable),
    Overflow(OverflowError),
    ErrorReporting,
    Ambiguous(Vec<DefId, Global>),
}

Variants

Unimplemented

The trait is not implemented.

OutputTypeParameterMismatch(Binder<'tcx, TraitRef<'tcx>>, Binder<'tcx, TraitRef<'tcx>>, TypeError<'tcx>)

After a closure impl has selected, its “outputs” were evaluated (which for closures includes the “input” type params) and they didn’t resolve. See confirm_poly_trait_refs for more.

TraitNotObjectSafe(DefId)

The trait pointed by DefId is not object safe.

NotConstEvaluatable(NotConstEvaluatable)

A given constant couldn’t be evaluated.

Overflow(OverflowError)

Exceeded the recursion depth during type projection.

ErrorReporting

Signaling that an error has already been emitted, to avoid multiple errors being shown.

Ambiguous(Vec<DefId, Global>)

Multiple applicable impls where found. The DefIds correspond to all the impls’ Items.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Whether this makes sense to suggest in a diagnostic. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 80 bytes

Size for each variant:

  • Unimplemented: 0 bytes
  • OutputTypeParameterMismatch: 80 bytes
  • TraitNotObjectSafe: 8 bytes
  • NotConstEvaluatable: 1 byte
  • Overflow: 1 byte
  • ErrorReporting: 0 bytes
  • Ambiguous: 24 bytes