rustc_infer::traits

Type Alias Selection

Source
pub type Selection<'tcx> = ImplSource<'tcx, PredicateObligation<'tcx>>;

Aliased Type§

enum Selection<'tcx> {
    UserDefined(ImplSourceUserDefinedData<'tcx, Obligation<'tcx, Predicate<'tcx>>>),
    Param(ThinVec<Obligation<'tcx, Predicate<'tcx>>>),
    Builtin(BuiltinImplSource, ThinVec<Obligation<'tcx, Predicate<'tcx>>>),
}

Variants§

§

UserDefined(ImplSourceUserDefinedData<'tcx, Obligation<'tcx, Predicate<'tcx>>>)

ImplSource identifying a particular impl.

§

Param(ThinVec<Obligation<'tcx, Predicate<'tcx>>>)

Successful resolution to an obligation provided by the caller for some type parameter. The Vec<N> represents the obligations incurred from normalizing the where-clause (if any).

§

Builtin(BuiltinImplSource, ThinVec<Obligation<'tcx, Predicate<'tcx>>>)

Successful resolution for a builtin impl.

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

Size for each variant:

  • UserDefined: 24 bytes
  • Param: 8 bytes
  • Builtin: 24 bytes

Implementations

Source§

impl<'tcx, N> ImplSource<'tcx, N>

Source

pub fn nested_obligations(self) -> ThinVec<N>

Source

pub fn borrow_nested_obligations(&self) -> &[N]

Source

pub fn borrow_nested_obligations_mut(&mut self) -> &mut [N]

Source

pub fn map<M, F>(self, f: F) -> ImplSource<'tcx, M>
where F: FnMut(N) -> M,

Trait Implementations

Source§

impl<'tcx, N> Clone for ImplSource<'tcx, N>
where N: Clone,

Source§

fn clone(&self) -> ImplSource<'tcx, N>

Returns a copy of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'tcx, N> Debug for ImplSource<'tcx, N>
where N: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'tcx, N, __D> Decodable<__D> for ImplSource<'tcx, N>
where __D: TyDecoder<I = TyCtxt<'tcx>>, ImplSourceUserDefinedData<'tcx, N>: Decodable<__D>, ThinVec<N>: Decodable<__D>,

Source§

fn decode(__decoder: &mut __D) -> ImplSource<'tcx, N>

Source§

impl<'tcx, N, __E> Encodable<__E> for ImplSource<'tcx, N>
where __E: TyEncoder<I = TyCtxt<'tcx>>, ImplSourceUserDefinedData<'tcx, N>: Encodable<__E>, ThinVec<N>: Encodable<__E>,

Source§

fn encode(&self, __encoder: &mut __E)

Source§

impl<'tcx, '__ctx, N> HashStable<StableHashingContext<'__ctx>> for ImplSource<'tcx, N>
where N: HashStable<StableHashingContext<'__ctx>>,

Source§

fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher<SipHasher128>, )

Source§

impl<'tcx, N> PartialEq for ImplSource<'tcx, N>
where N: PartialEq,

Source§

fn eq(&self, other: &ImplSource<'tcx, N>) -> bool

Tests for self and other values to be equal, and is used by ==.
Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'tcx, N> TypeFoldable<TyCtxt<'tcx>> for ImplSource<'tcx, N>
where N: TypeFoldable<TyCtxt<'tcx>>,

Source§

fn try_fold_with<__F>( self, __folder: &mut __F, ) -> Result<ImplSource<'tcx, N>, <__F as FallibleTypeFolder<TyCtxt<'tcx>>>::Error>
where __F: FallibleTypeFolder<TyCtxt<'tcx>>,

The entry point for folding. To fold a value t with a folder f call: t.try_fold_with(f). Read more
§

fn fold_with<F>(self, folder: &mut F) -> Self
where F: TypeFolder<I>,

A convenient alternative to try_fold_with for use with infallible folders. Do not override this method, to ensure coherence with try_fold_with.
Source§

impl<'tcx, N> TypeVisitable<TyCtxt<'tcx>> for ImplSource<'tcx, N>
where N: TypeVisitable<TyCtxt<'tcx>>,

Source§

fn visit_with<__V>( &self, __visitor: &mut __V, ) -> <__V as TypeVisitor<TyCtxt<'tcx>>>::Result
where __V: TypeVisitor<TyCtxt<'tcx>>,

The entry point for visiting. To visit a value t with a visitor v call: t.visit_with(v). Read more
Source§

impl<'tcx, N> Eq for ImplSource<'tcx, N>
where N: Eq,

Source§

impl<'tcx, N> StructuralPartialEq for ImplSource<'tcx, N>