diff --git a/src/bun_alloc/lib.rs b/src/bun_alloc/lib.rs index 5f95396c96d1..636386df988d 100644 --- a/src/bun_alloc/lib.rs +++ b/src/bun_alloc/lib.rs @@ -1685,8 +1685,8 @@ pub unsafe fn free_sensitive_cstr(p: *const core::ffi::c_char) { // size-agnostic). unsafe { let len = libc::strlen(p); - secure_zero(p as *mut u8, len); - crate::default_alloc::free(p as *mut core::ffi::c_void); + secure_zero(p.cast::().cast_mut(), len); + crate::default_alloc::free(p.cast::().cast_mut()); } } diff --git a/src/bun_core/util.rs b/src/bun_core/util.rs index d4a068b424ee..c71a8f08d0c8 100644 --- a/src/bun_core/util.rs +++ b/src/bun_core/util.rs @@ -3927,7 +3927,7 @@ pub fn dupe_z(bytes: &[u8]) -> *const core::ffi::c_char { core::ptr::copy_nonoverlapping(bytes.as_ptr(), p, bytes.len()); *p.add(bytes.len()) = 0; } - p as *const core::ffi::c_char + p.cast_const().cast::() } /// Port of `bun.freeSensitive(bun.default_allocator, slice)` for the C-string diff --git a/src/runtime/server/FileResponseStream.rs b/src/runtime/server/FileResponseStream.rs index 48937b01ca9c..b77f829c93ea 100644 --- a/src/runtime/server/FileResponseStream.rs +++ b/src/runtime/server/FileResponseStream.rs @@ -68,6 +68,11 @@ struct Sendfile { has_set_on_writable: bool, } +#[allow( + clippy::derivable_impls, + reason = "only derivable where the linux/android-gated fields are absent; `Fd` has no \ + `Default` impl, so `#[derive(Default)]` would not compile on linux/android" +)] impl Default for Sendfile { fn default() -> Self { Self {