Struct rustc_mir_transform::check_unsafety::UnsafetyChecker [−][src]
pub struct UnsafetyChecker<'a, 'tcx> {
body: &'a Body<'tcx>,
body_did: LocalDefId,
violations: Vec<UnsafetyViolation>,
source_info: SourceInfo,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
used_unsafe: FxHashSet<HirId>,
inherited_blocks: Vec<(HirId, bool)>,
}
Fields
body: &'a Body<'tcx>
body_did: LocalDefId
violations: Vec<UnsafetyViolation>
source_info: SourceInfo
tcx: TyCtxt<'tcx>
param_env: ParamEnv<'tcx>
used_unsafe: FxHashSet<HirId>
Mark an unsafe
block as used, so we don’t lint it.
inherited_blocks: Vec<(HirId, bool)>
Implementations
fn register_violations(
&mut self,
violations: &[UnsafetyViolation],
unsafe_blocks: &[(HirId, bool)]
)
fn check_mut_borrowing_layout_constrained_field(
&mut self,
place: Place<'tcx>,
is_mut_use: bool
)
Checks whether calling func_did
needs an unsafe
context or not, i.e. whether
the called function has target features the calling function hasn’t.
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, 'tcx> !RefUnwindSafe for UnsafetyChecker<'a, 'tcx>
impl<'a, 'tcx> !Send for UnsafetyChecker<'a, 'tcx>
impl<'a, 'tcx> !Sync for UnsafetyChecker<'a, 'tcx>
impl<'a, 'tcx> Unpin for UnsafetyChecker<'a, 'tcx> where
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for UnsafetyChecker<'a, '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: 120 bytes