Struct rustc_lint::types::ImproperCTypesVisitor
source · struct ImproperCTypesVisitor<'a, 'tcx> {
cx: &'a LateContext<'tcx>,
mode: CItemKind,
}
Fields§
§cx: &'a LateContext<'tcx>
§mode: CItemKind
Implementations§
source§impl<'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,
args: GenericArgsRef<'tcx>
) -> FfiResult<'tcx>
fn check_field_type_for_ffi( &self, cache: &mut FxHashSet<Ty<'tcx>>, field: &FieldDef, args: GenericArgsRef<'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,
args: GenericArgsRef<'tcx>
) -> FfiResult<'tcx>
fn check_variant_for_ffi( &self, cache: &mut FxHashSet<Ty<'tcx>>, ty: Ty<'tcx>, def: AdtDef<'tcx>, variant: &VariantDef, args: GenericArgsRef<'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 )
sourcefn check_fn(&mut self, def_id: LocalDefId, decl: &'tcx FnDecl<'_>)
fn check_fn(&mut self, def_id: LocalDefId, decl: &'tcx FnDecl<'_>)
Check if a function’s argument types and result type are “ffi-safe”.
For a external ABI function, argument types and the result type are walked to find fn-ptr types that have external ABIs, as these still need checked.
sourcefn check_foreign_fn(&mut self, def_id: LocalDefId, decl: &'tcx FnDecl<'_>)
fn check_foreign_fn(&mut self, def_id: LocalDefId, decl: &'tcx FnDecl<'_>)
Check if a function’s argument types and result type are “ffi-safe”.
fn check_foreign_static(&mut self, id: OwnerId, 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>
impl<'a, 'tcx> !UnwindSafe for ImproperCTypesVisitor<'a, 'tcx>
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
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