[−][src]Struct rustc_mir::transform::check_unsafety::UnsafetyChecker

pub struct UnsafetyChecker<'a, 'tcx> {
    body: &'a Body<'tcx>,
    body_did: LocalDefId,
    const_context: bool,
    min_const_fn: bool,
    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: LocalDefIdconst_context: boolmin_const_fn: boolviolations: Vec<UnsafetyViolation>source_info: SourceInfotcx: 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

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

pub(in transform::check_unsafety) fn new(
    const_context: bool,
    min_const_fn: bool,
    body: &'a Body<'tcx>,
    body_did: LocalDefId,
    tcx: TyCtxt<'tcx>,
    param_env: ParamEnv<'tcx>
) -> Self
[src]

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

pub(in transform::check_unsafety) fn require_unsafe(
    &mut self,
    kind: UnsafetyViolationKind,
    details: UnsafetyViolationDetails
)
[src]

pub(in transform::check_unsafety) fn register_violations(
    &mut self,
    violations: &[UnsafetyViolation],
    unsafe_blocks: &[(HirId, bool)]
)
[src]

pub(in transform::check_unsafety) fn check_mut_borrowing_layout_constrained_field(
    &mut self,
    place: Place<'tcx>,
    is_mut_use: bool
)
[src]

pub(in transform::check_unsafety) fn check_target_features(
    &mut self,
    func_did: DefId
)
[src]

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

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

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

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]