Skip to content

Commit 0466ec8

Browse files
committed
FRTs & FFI
1 parent ff24417 commit 0466ec8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ lint_improper_ctypes_enum_repr_help =
373373
consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
374374
375375
lint_improper_ctypes_enum_repr_reason = enum has no representation hint
376+
lint_improper_ctypes_field_representing_type_reason = field representing types have no C equivalent
376377
lint_improper_ctypes_fnptr_help = consider using an `extern fn(...) -> ...` function pointer instead
377378
378379
lint_improper_ctypes_fnptr_reason = this function pointer has Rust-specific calling convention

compiler/rustc_lint/src/types/improper_ctypes.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,12 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
569569
}
570570
}
571571

572+
ty::Field(..) => FfiUnsafe {
573+
ty,
574+
reason: fluent::lint_improper_ctypes_field_representing_type_reason,
575+
help: None,
576+
},
577+
572578
ty::Char => FfiUnsafe {
573579
ty,
574580
reason: fluent::lint_improper_ctypes_char_reason,

0 commit comments

Comments
 (0)