Skip to content

fix(runtime): drop c_int imports left behind by the longjmp removal - #9351

Merged
proggeramlug merged 1 commit into
mainfrom
fix/unused-c-int
Sep 1, 2026
Merged

fix(runtime): drop c_int imports left behind by the longjmp removal#9351
proggeramlug merged 1 commit into
mainfrom
fix/unused-c-int

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The warnings gate fails on the release candidate (e539a6359e, run 33457888163) with five instances of the same error:

error: unused import: `std::os::raw::c_int`
  --> crates/perry-runtime/src/native_abi.rs:478:9
  = note: `-D unused-imports` implied by `-D warnings`

Also native_arena.rs:475, native_handle.rs:411, node_stream_tests.rs:6, object/tests.rs:5.

Each of those files 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.

ffi/setjmp.rs keeps its import: it still uses c_int 16 times for the real extern signature (unsafe extern "C" fn(*mut c_int) -> c_int). I checked that one specifically rather than removing every match.

warnings is in full-suite-gate's needs, so this blocks the v0.5.1519 release.

Why the PR tier missed it

Worth a look from someone who knows the tier layout better than I do: these are all #[cfg(test)] modules, so they only surface in a build that includes test targets. If the PR tier's warnings step doesn't cover --all-targets for the affected crate, or scopes to the diff, an unused import inside a test module can land without ever being compiled. That would make this class recur.

Summary by CodeRabbit

  • Chores

    • Removed unused imports from runtime test modules.
    • Cleaned up compiler warnings, allowing builds configured to treat warnings as errors to complete successfully.
    • No runtime behavior or test logic was changed.
  • Documentation

    • Added a changelog entry describing the warning cleanup and affected test modules.

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.
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 2c3b01e6-672b-4e5c-bf88-23d9e5d99c0d

📥 Commits

Reviewing files that changed from the base of the PR and between c78cf37 and 1fa45a7.

📒 Files selected for processing (6)
  • changelog.d/9351-unused-c-int.md
  • crates/perry-runtime/src/native_abi.rs
  • crates/perry-runtime/src/native_arena.rs
  • crates/perry-runtime/src/native_handle.rs
  • crates/perry-runtime/src/node_stream_tests.rs
  • crates/perry-runtime/src/object/tests.rs
💤 Files with no reviewable changes (5)
  • crates/perry-runtime/src/object/tests.rs
  • crates/perry-runtime/src/node_stream_tests.rs
  • crates/perry-runtime/src/native_abi.rs
  • crates/perry-runtime/src/native_arena.rs
  • crates/perry-runtime/src/native_handle.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • changelog.d/9351-unused-c-int.md

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Four unused c_int imports were removed from perry-runtime test modules. A changelog entry records the cleanup and the related -D warnings build failure.

Changes

Warnings cleanup

Layer / File(s) Summary
Remove unused test imports
crates/perry-runtime/src/native_abi.rs, crates/perry-runtime/src/native_arena.rs, crates/perry-runtime/src/native_handle.rs, crates/perry-runtime/src/node_stream_tests.rs, changelog.d/9351-unused-c-int.md
Removed unused c_int imports from four test modules and recorded the warnings-gate fix in the changelog.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 1fa45

This PR removes unused imports without changing runtime behavior, so no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description gives a detailed problem statement and explains the affected files, cause, retained import, and release impact. It does not follow the repository template and omits the required Summar… Rewrite the description using the repository template. Add explicit Summary and Changes sections, state the related issue or use "n/a", document the verification commands and results, and complete the required Checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the runtime cleanup: removing unused c_int imports left after longjmp removal. It is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description gives a detailed problem statement and explains the affected files, cause, retained import, and release impact. It does not follow the repository template and omits the required Summary, Changes, Related issue, Test plan, and Checklist sections.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unused-c-int

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit 61e7df8 into main Sep 1, 2026
19 of 20 checks passed
@proggeramlug
proggeramlug deleted the fix/unused-c-int branch September 1, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant