Open
Description
This is the estranged cousin of
improper_ctypes
lint triggers on valid#[repr(transparent)]
types #115457- The improper_ctypes lint is very weak #36464
This code is erroneously accepted (Playground):
#![deny(improper_ctypes)]
#![deny(improper_ctypes_definitions)]
#[repr(transparent)]
pub struct Array([u64; 2]);
#[no_mangle]
pub unsafe extern "C" fn function(arg: Array) -> Array {
arg
}
It has an invalid repr in the C ABI, as I understand it.
Meta
rustc --version --verbose
:
rustc 1.75.0-nightly (49691b1f7 2023-10-16)
binary: rustc
commit-hash: 49691b1f70d71dd7b8349c332b7f277ee527bf08
commit-date: 2023-10-16
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2