struct UnsafeVisitor<'db> {
db: &'db dyn HirDatabase,
infer: &'db InferenceResult<'db>,
body: &'db ExpressionStore,
resolver: Resolver<'db>,
def: ExpressionStoreOwnerId,
inside_unsafe_block: InsideUnsafeBlock,
inside_assignment: bool,
inside_union_destructure: bool,
callback: &'db mut dyn FnMut(UnsafeDiagnostic),
def_target_features: TargetFeatures<'db>,
edition: Edition,
target_feature_is_safe: TargetFeatureIsSafeInTarget,
}Fields§
§db: &'db dyn HirDatabase§infer: &'db InferenceResult<'db>§body: &'db ExpressionStore§resolver: Resolver<'db>§def: ExpressionStoreOwnerId§inside_unsafe_block: InsideUnsafeBlock§inside_assignment: bool§inside_union_destructure: bool§callback: &'db mut dyn FnMut(UnsafeDiagnostic)§def_target_features: TargetFeatures<'db>§edition: Edition§target_feature_is_safe: TargetFeatureIsSafeInTargetOn some targets (WASM), calling safe functions with #[target_feature] is always safe, even when
the target feature is not enabled. This flag encodes that.
Implementations§
Source§impl<'db> UnsafeVisitor<'db>
impl<'db> UnsafeVisitor<'db>
fn new( db: &'db dyn HirDatabase, infer: &'db InferenceResult<'db>, body: &'db ExpressionStore, def: ExpressionStoreOwnerId, unsafe_expr_cb: &'db mut dyn FnMut(UnsafeDiagnostic), ) -> Self
fn on_unsafe_op(&mut self, node: ExprOrPatId, reason: UnsafetyReason)
fn check_call(&mut self, node: ExprId, func: FunctionId)
fn with_inside_unsafe_block<R>( &mut self, inside_unsafe_block: InsideUnsafeBlock, f: impl FnOnce(&mut Self) -> R, ) -> R
fn walk_pats_top( &mut self, pats: impl Iterator<Item = PatId>, parent_expr: ExprId, )
fn walk_pat(&mut self, current: PatId)
fn walk_expr(&mut self, current: ExprId)
fn mark_unsafe_path(&mut self, node: ExprOrPatId, path: &Path)
Auto Trait Implementations§
impl<'db> Freeze for UnsafeVisitor<'db>
impl<'db> !RefUnwindSafe for UnsafeVisitor<'db>
impl<'db> !Send for UnsafeVisitor<'db>
impl<'db> !Sync for UnsafeVisitor<'db>
impl<'db> Unpin for UnsafeVisitor<'db>
impl<'db> UnsafeUnpin for UnsafeVisitor<'db>
impl<'db> !UnwindSafe for UnsafeVisitor<'db>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more