[−][src]Struct rustc_trait_selection::autoderef::Autoderef

pub struct Autoderef<'a, 'tcx> {
    infcx: &'a InferCtxt<'a, 'tcx>,
    span: Span,
    overloaded_span: Span,
    body_id: HirId,
    param_env: ParamEnv<'tcx>,
    state: AutoderefSnapshot<'tcx>,
    include_raw_pointers: bool,
    silence_errors: bool,
}

Fields

infcx: &'a InferCtxt<'a, 'tcx>span: Spanoverloaded_span: Spanbody_id: HirIdparam_env: ParamEnv<'tcx>state: AutoderefSnapshot<'tcx>include_raw_pointers: boolsilence_errors: bool

Implementations

impl<'a, 'tcx> Autoderef<'a, 'tcx>[src]

pub fn new(
    infcx: &'a InferCtxt<'a, 'tcx>,
    param_env: ParamEnv<'tcx>,
    body_id: HirId,
    span: Span,
    base_ty: Ty<'tcx>,
    overloaded_span: Span
) -> Autoderef<'a, 'tcx>ⓘ

Notable traits for Autoderef<'a, 'tcx>

impl<'a, 'tcx> Iterator for Autoderef<'a, 'tcx> type Item = (Ty<'tcx>, usize);
[src]

pub(in autoderef) fn overloaded_deref_ty(
    &mut self,
    ty: Ty<'tcx>
) -> Option<Ty<'tcx>>
[src]

pub fn final_ty(&self, resolve: bool) -> Ty<'tcx>[src]

Returns the final type we ended up with, which may be an inference variable (we will resolve it first, if we want).

pub fn step_count(&self) -> usize[src]

pub fn into_obligations(self) -> Vec<PredicateObligation<'tcx>>[src]

pub fn steps(&self) -> &[(Ty<'tcx>, AutoderefKind)][src]

pub fn span(&self) -> Span[src]

pub fn overloaded_span(&self) -> Span[src]

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

pub fn include_raw_pointers(self) -> Self[src]

also dereference through raw pointer types e.g., assuming ptr_to_Foo is the type *const Foo fcx.autoderef(span, ptr_to_Foo) => [*const Foo] fcx.autoderef(span, ptr_to_Foo).include_raw_ptrs() => [*const Foo, Foo]

pub fn silence_errors(self) -> Self[src]

Trait Implementations

impl<'a, 'tcx> Iterator for Autoderef<'a, 'tcx>[src]

type Item = (Ty<'tcx>, usize)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, 'tcx> !RefUnwindSafe for Autoderef<'a, 'tcx>

impl<'a, 'tcx> !Send for Autoderef<'a, 'tcx>

impl<'a, 'tcx> !Sync for Autoderef<'a, 'tcx>

impl<'a, 'tcx> Unpin for Autoderef<'a, 'tcx> where
    'tcx: 'a, 

impl<'a, 'tcx> !UnwindSafe for Autoderef<'a, '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]