Struct rustc_lint::types::ImproperCTypesVisitor
source · struct ImproperCTypesVisitor<'a, 'tcx> {
cx: &'a LateContext<'tcx>,
mode: CItemKind,
}
Fields
cx: &'a LateContext<'tcx>
mode: CItemKind
Implementations
sourceimpl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx>
impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx>
sourcefn check_for_array_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool
fn check_for_array_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool
Check if the type is array and emit an unsafe type lint.
sourcefn check_field_type_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
field: &FieldDef,
substs: SubstsRef<'tcx>
) -> FfiResult<'tcx>
fn check_field_type_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
field: &FieldDef,
substs: SubstsRef<'tcx>
) -> FfiResult<'tcx>
Checks if the given field’s type is “ffi-safe”.
sourcefn check_variant_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
ty: Ty<'tcx>,
def: AdtDef<'tcx>,
variant: &VariantDef,
substs: SubstsRef<'tcx>
) -> FfiResult<'tcx>
fn check_variant_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
ty: Ty<'tcx>,
def: AdtDef<'tcx>,
variant: &VariantDef,
substs: SubstsRef<'tcx>
) -> FfiResult<'tcx>
Checks if the given VariantDef
’s field types are “ffi-safe”.
sourcefn check_type_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
ty: Ty<'tcx>
) -> FfiResult<'tcx>
fn check_type_for_ffi(
&self,
cache: &mut FxHashSet<Ty<'tcx>>,
ty: Ty<'tcx>
) -> FfiResult<'tcx>
Checks if the given type is “ffi-safe” (has a stable, well-defined representation which can be exported to C code).
fn emit_ffi_unsafe_type_lint(
&mut self,
ty: Ty<'tcx>,
sp: Span,
note: DiagnosticMessage,
help: Option<DiagnosticMessage>
)
fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool
fn check_type_for_ffi_and_report_errors(
&mut self,
sp: Span,
ty: Ty<'tcx>,
is_static: bool,
is_return_type: bool
)
fn check_foreign_fn(&mut self, id: HirId, decl: &FnDecl<'_>)
fn check_foreign_static(&mut self, id: HirId, span: Span)
fn is_internal_abi(&self, abi: SpecAbi) -> bool
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for ImproperCTypesVisitor<'a, 'tcx>
impl<'a, 'tcx> !Send for ImproperCTypesVisitor<'a, 'tcx>
impl<'a, 'tcx> !Sync for ImproperCTypesVisitor<'a, 'tcx>
impl<'a, 'tcx> Unpin for ImproperCTypesVisitor<'a, 'tcx>where
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for ImproperCTypesVisitor<'a, 'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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: 16 bytes