add improper_ctypes_definitions lint

This commit is contained in:
auronandace
2026-02-14 16:48:39 +00:00
parent 0cf3f8af92
commit 2c53eb1f6d
6 changed files with 10 additions and 7 deletions
+1
View File
@@ -30,6 +30,7 @@ zero_ptr = "warn" # must allow on public constants due to cbindgen issue
[workspace.lints.rust]
dangling_pointers_from_temporaries = "deny"
improper_ctypes_definitions = "deny"
internal_features = "allow" # core_intrinsics and lang_items
irrefutable_let_patterns = "deny"
mismatched_lifetime_syntaxes = "deny"
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct user_fpsimd_struct {
}
pub type elf_greg_t = c_ulong;
pub type elf_gregset_t = [c_ulong; 34];
pub type elf_gregset_t = *mut [c_ulong; 34];
pub type elf_fpregset_t = user_fpsimd_struct;
#[unsafe(no_mangle)]
+1 -1
View File
@@ -50,7 +50,7 @@ pub struct user_regs_struct {
pub type elf_greg_t = c_ulong;
pub type elf_gregset_t = [c_ulong; 27];
pub type elf_gregset_t = *mut [c_ulong; 27];
pub type elf_fpregset_t = user_fpregs_struct;
#[repr(C)]
pub struct user {
+1 -1
View File
@@ -59,7 +59,7 @@ pub struct elf_prpsinfo {
}
pub type psaddr_t = *mut c_void;
pub type prgregset_t = elf_gregset_t;
pub type prgregset_t = *mut elf_gregset_t;
pub type prfpregset_t = elf_fpregset_t;
pub type lwpid_t = pid_t;
pub type prstatus_t = elf_prstatus;
+4 -4
View File
@@ -282,11 +282,11 @@ pub extern "C" fn dup3(fildes: c_int, fildes2: c_int, flag: c_int) -> c_int {
///
/// # Deprecation
/// The `encrypt()` function was marked obsolescent in the Open Group Base Specifications Issue 8.
#[deprecated]
//#[deprecated]
// #[unsafe(no_mangle)]
pub extern "C" fn encrypt(block: [c_char; 64], edflag: c_int) {
unimplemented!();
}
//pub extern "C" fn encrypt(block: [c_char; 64], edflag: c_int) {
// unimplemented!();
//}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/exec.html>.
#[unsafe(no_mangle)]
+2
View File
@@ -88,8 +88,10 @@ pub extern "C" fn rust_eh_personality() {}
#[cfg(not(test))]
#[alloc_error_handler]
#[linkage = "weak"]
#[allow(improper_ctypes_definitions)]
#[unsafe(no_mangle)]
pub extern "C" fn rust_oom(layout: ::core::alloc::Layout) -> ! {
// Layout not FFI-safe?
use core::fmt::Write;
let mut w = platform::FileWriter::new(2);