From 1fa45a7db294f18987f2c44deaa0d3c4088c8408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Tue, 1 Sep 2026 05:10:20 +0200 Subject: [PATCH] fix(runtime): drop c_int imports left behind by the longjmp removal The warnings gate fails on the release candidate with five instances of error: unused import: `std::os::raw::c_int` = note: `-D unused-imports` implied by `-D warnings` in native_abi.rs, native_arena.rs, native_handle.rs, node_stream_tests.rs and object/tests.rs. Each file contains exactly one occurrence of c_int -- the import itself -- so nothing references them. They are residue from #9305/#9323 ('no Rust frame is ever a longjmp target'), which removed the setjmp/longjmp call sites that took c_int arguments but left the imports behind. ffi/setjmp.rs keeps its import: it still uses c_int 16 times for the real extern signature. --- changelog.d/9351-unused-c-int.md | 3 +++ crates/perry-runtime/src/native_abi.rs | 1 - crates/perry-runtime/src/native_arena.rs | 1 - crates/perry-runtime/src/native_handle.rs | 1 - crates/perry-runtime/src/node_stream_tests.rs | 1 - crates/perry-runtime/src/object/tests.rs | 1 - 6 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 changelog.d/9351-unused-c-int.md diff --git a/changelog.d/9351-unused-c-int.md b/changelog.d/9351-unused-c-int.md new file mode 100644 index 0000000000..3828208339 --- /dev/null +++ b/changelog.d/9351-unused-c-int.md @@ -0,0 +1,3 @@ +The `warnings` gate is green again. Five test modules in `perry-runtime` still +imported `std::os::raw::c_int` after the code that used it was removed, which +fails a `-D warnings` build. diff --git a/crates/perry-runtime/src/native_abi.rs b/crates/perry-runtime/src/native_abi.rs index 3b197028ed..7f70874589 100644 --- a/crates/perry-runtime/src/native_abi.rs +++ b/crates/perry-runtime/src/native_abi.rs @@ -475,7 +475,6 @@ pub extern "C" fn js_native_abi_check_pod_object(value: f64) -> i64 { #[cfg(test)] mod tests { use super::*; - use std::os::raw::c_int; fn catch_runtime_throw(f: impl FnOnce()) -> bool { crate::exception::catch_js_throw(f).is_err() diff --git a/crates/perry-runtime/src/native_arena.rs b/crates/perry-runtime/src/native_arena.rs index d0f12e585e..567b719a50 100644 --- a/crates/perry-runtime/src/native_arena.rs +++ b/crates/perry-runtime/src/native_arena.rs @@ -472,7 +472,6 @@ pub(crate) unsafe fn finalize_native_pod_view_for_gc(view: *mut NativePodViewHea #[cfg(test)] mod tests { use super::*; - use std::os::raw::c_int; fn boxed_ptr(ptr: *const u8) -> f64 { f64::from_bits(crate::value::JSValue::pointer(ptr).bits()) diff --git a/crates/perry-runtime/src/native_handle.rs b/crates/perry-runtime/src/native_handle.rs index 1d0d31e887..8d4d0901ff 100644 --- a/crates/perry-runtime/src/native_handle.rs +++ b/crates/perry-runtime/src/native_handle.rs @@ -408,7 +408,6 @@ pub(crate) unsafe fn finalize_native_handle_for_gc(handle: *mut NativeHandleHead #[cfg(test)] mod tests { use super::*; - use std::os::raw::c_int; /// The teardown-diagnostics gate must block every thread except the /// recorded owner — the unrecorded arm waving workers through is exactly diff --git a/crates/perry-runtime/src/node_stream_tests.rs b/crates/perry-runtime/src/node_stream_tests.rs index 06c756bbad..19aa3f717a 100644 --- a/crates/perry-runtime/src/node_stream_tests.rs +++ b/crates/perry-runtime/src/node_stream_tests.rs @@ -3,7 +3,6 @@ use super::*; use std::cell::RefCell; -use std::os::raw::c_int; thread_local! { pub(super) static WRITE_CAPTURED: RefCell>> = const { RefCell::new(Vec::new()) }; diff --git a/crates/perry-runtime/src/object/tests.rs b/crates/perry-runtime/src/object/tests.rs index 37c23d7850..ec8b14aa3d 100644 --- a/crates/perry-runtime/src/object/tests.rs +++ b/crates/perry-runtime/src/object/tests.rs @@ -2,7 +2,6 @@ #![cfg(test)] use super::*; -use std::os::raw::c_int; #[test] fn call_method_depth_drop_is_idempotent_after_exception_restore() {