[][src]Struct rustc_mir::borrow_check::type_check::TypeVerifier

struct TypeVerifier<'a, 'b, 'tcx> {
    cx: &'a mut TypeChecker<'b, 'tcx>,
    body: &'b Body<'tcx>,
    promoted: &'b IndexVec<Promoted, Body<'tcx>>,
    last_span: Span,
    mir_def_id: LocalDefId,
    errors_reported: bool,
}

Verifies that MIR types are sane to not crash further checks.

The sanitize_XYZ methods here take an MIR object and compute its type, calling span_mirbug and returning an error type if there is a problem.

Fields

cx: &'a mut TypeChecker<'b, 'tcx>body: &'b Body<'tcx>promoted: &'b IndexVec<Promoted, Body<'tcx>>last_span: Spanmir_def_id: LocalDefIderrors_reported: bool

Implementations

impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx>[src]

fn new(
    cx: &'a mut TypeChecker<'b, 'tcx>,
    body: &'b Body<'tcx>,
    promoted: &'b IndexVec<Promoted, Body<'tcx>>
) -> Self
[src]

fn tcx(&self) -> TyCtxt<'tcx>[src]

fn sanitize_type(&mut self, parent: &dyn Debug, ty: Ty<'tcx>) -> Ty<'tcx>[src]

fn sanitize_place(
    &mut self,
    place: &Place<'tcx>,
    location: Location,
    context: PlaceContext
) -> PlaceTy<'tcx>
[src]

Checks that the types internal to the place match up with what would be expected.

fn sanitize_promoted(
    &mut self,
    promoted_body: &'b Body<'tcx>,
    location: Location
)
[src]

fn sanitize_projection(
    &mut self,
    base: PlaceTy<'tcx>,
    pi: PlaceElem<'tcx>,
    place: &Place<'tcx>,
    location: Location
) -> PlaceTy<'tcx>
[src]

fn error(&mut self) -> Ty<'tcx>[src]

fn field_ty(
    &mut self,
    parent: &dyn Debug,
    base_ty: PlaceTy<'tcx>,
    field: Field,
    location: Location
) -> Result<Ty<'tcx>, FieldAccessError>
[src]

Trait Implementations

impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx>[src]

Auto Trait Implementations

impl<'a, 'b, 'tcx> !RefUnwindSafe for TypeVerifier<'a, 'b, 'tcx>

impl<'a, 'b, 'tcx> !Send for TypeVerifier<'a, 'b, 'tcx>

impl<'a, 'b, 'tcx> !Sync for TypeVerifier<'a, 'b, 'tcx>

impl<'a, 'b, 'tcx> Unpin for TypeVerifier<'a, 'b, 'tcx> where
    'b: 'a,
    'tcx: 'b + 'a, 

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