Struct rustc_borrowck::type_check::TypeVerifier [−][src]
struct TypeVerifier<'a, 'b, 'tcx> {
cx: &'a mut TypeChecker<'b, 'tcx>,
body: &'b Body<'tcx>,
promoted: &'b IndexVec<Promoted, Body<'tcx>>,
last_span: Span,
errors_reported: bool,
}
Expand description
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: Span
errors_reported: bool
Implementations
fn new(
cx: &'a mut TypeChecker<'b, 'tcx>,
body: &'b Body<'tcx>,
promoted: &'b IndexVec<Promoted, Body<'tcx>>
) -> Self
fn sanitize_place(
&mut self,
place: &Place<'tcx>,
location: Location,
context: PlaceContext
) -> PlaceTy<'tcx>
fn sanitize_place(
&mut self,
place: &Place<'tcx>,
location: Location,
context: PlaceContext
) -> PlaceTy<'tcx>
Checks that the types internal to the place
match up with
what would be expected.
Trait Implementations
fn visit_ascribe_user_ty(
&mut self,
place: &Place<'tcx>,
variance: &Variance,
user_ty: &UserTypeProjection,
location: Location
)
fn visit_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn visit_projection_elem(
&mut self,
local: Local,
proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
context: PlaceContext,
location: Location
)
fn super_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn super_projection_elem(
&mut self,
_local: Local,
_proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
_context: PlaceContext,
location: Location
)
fn visit_user_type_annotation(
&mut self,
index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
fn super_ascribe_user_ty(
&mut self,
place: &Place<'tcx>,
_variance: &Variance,
user_ty: &UserTypeProjection,
location: Location
)
fn super_user_type_annotation(
&mut self,
_index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
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: 'a + 'b,
impl<'a, 'b, 'tcx> !UnwindSafe for TypeVerifier<'a, 'b, 'tcx>
Blanket Implementations
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: 40 bytes