add improper_ctypes_definitions lint
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user