Skip to content

fix: the -D warnings errors in perry-runtime's and perry-wpfacts' tests - #14871

Merged
TheHypnoo merged 2 commits into
PerryTS:mainfrom
raliclo:fix/main-red-test-warnings
Nov 18, 2026
Merged

TheHypnoo merged 2 commits into
PerryTS:mainfrom
raliclo:fix/main-red-test-warnings

Conversation

@raliclo

@raliclo raliclo commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The warnings job's all-targets check fails on main 028b066 in test code of two crates. On CI it is currently hidden behind earlier errors, and on this branch's measurements each item below is the whole remaining list for its crate: two fn-item-to-integer casts and one nested unsafe in perry-runtime's tests, and dead test helpers in perry-wpfacts.

Changes

  • crates/perry-runtime/src/snap_image/tests.rs:607,618: registry_probe_init as usize → as *const () as usize (function_casts_as_integer; from 3fff06c; these tests compile only on Linux x86_64).
  • crates/perry-runtime/src/object/class_registry/parent_static/symbol_members.rs:334: drop the unsafe block nested in the test's own unsafe (unused_unsafe; from 2060ef8).
  • crates/perry-wpfacts/src/tests/an8.rs: delete the uncalled copies_builtin_fn and ADD_I (314d80d); tests/an11.rs: delete the uncalled copies_builtin_fn (1fcff16) and the TmplKind import only it used.

Related issue

Refs #14595.

Test plan

  • RUSTFLAGS="-D warnings" cargo check -p perry-runtime -p perry-stdlib --lib --tests --target x86_64-unknown-linux-gnu (cross-checked from macOS, zig cc for the C deps): main → 3 errors (the casts and the nested unsafe); branch → Finished

  • RUSTFLAGS="-D warnings" cargo check -p perry-wpfacts --lib --tests: main → copies_builtin_fn ×2 / ADD_I never used; branch → Finished

  • cargo test -p perry-wpfacts --lib tests::an: 119 passed, 2 failed (annexb_accessors::native_function_receiver_uses_accessor_result, annexb_known_accessor::program_getter_on_the_debug_namespace_runs_its_body); the same two fail on main 028b066 (cargo test -p perry-wpfacts --lib tests::annexb), so none is new

  • BASE_SHA=upstream/main bash scripts/run_lint_gates.sh on this branch (macOS): 18 FAIL, the same set as the sibling branches; none is new. All-targets warnings stays red locally for macOS-only reasons (Linux-only snap_image items are dead code there) and for the codegen-wasm helper fixed in test(wasm): restore run_web_source_around, which the fetchWithAuth test calls #14870; formatting is style: cargo fmt the five files main left unformatted #14868.

  • I have NOT bumped the workspace version or edited CHANGELOG.md

  • changelog.d fragment added

🤖 Generated with Claude Code

https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p

Summary by CodeRabbit

  • Tests
    • Cleaned up test code to reduce warnings and remove unused test helpers. Existing runtime and analysis test coverage remains focused on its current behavior, with no changes to application functionality or user-facing features.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Walkthrough

The changes update runtime tests to use explicit function-pointer casts and remove an unnecessary unsafe block. They also remove unused helpers and an import from wpfacts tests. A changelog entry reports that the all-targets check is clean.

Changes: Test warning cleanup

Layer / File(s) Summary
Test code warning cleanup
crates/perry-runtime/src/snap_image/tests.rs, crates/perry-runtime/src/object/class_registry/parent_static/symbol_members.rs, crates/perry-wpfacts/src/tests/an11.rs, crates/perry-wpfacts/src/tests/an8.rs, changelog.d/14871-main-red-test-warnings.md
Runtime tests use explicit function-pointer casts and remove an unsafe block. Wpfacts tests remove an unused helper, fixture, and import. The changelog reports a clean all-targets check.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: proggeramlug, perry-bot

Merge Risk: Minimal · previous review b0a88

This PR only cleans up test code to satisfy warnings-as-errors and adds a changelog entry. It does not change runtime behavior and is safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix: the -D warnings errors in the test code of perry-runtime and perry-wpfacts. The changeset removes two function-item-to-integer casts, a nested unsafe block, and unused test he…
Description check Passed The description follows the repository template. It has a Summary, a Changes list with file paths, a Related issue (Refs #14595), and a Test plan with commands and results. It also has the checklist i…
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: Title check

Explanation

The title names the fix: the -D warnings errors in the test code of perry-runtime and perry-wpfacts. The changeset removes two function-item-to-integer casts, a nested unsafe block, and unused test helpers in those two crates, so the title matches the main change. The title uses the 'fix:' prefix that the repository log convention uses.

Full details: Description check

Explanation

The description follows the repository template. It has a Summary, a Changes list with file paths, a Related issue (Refs #14595), and a Test plan with commands and results. It also has the checklist items for not bumping the version or editing CHANGELOG.md, and it notes that a changelog.d fragment was added. The template's Test plan checkboxes for cargo build and cargo test --workspace are not marked, and the description does not explain why they were skipped. The description does not include a Screenshots section, which the template marks as optional.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a3d72e8-f674-4487-bf85-fd7dde274db3
Commits

Reviewing files that changed from the base of the PR and between 5bad3ad and b0a884c.

Files selected for processing: 5

  • changelog.d/14871-main-red-test-warnings.md
  • crates/perry-runtime/src/object/class_registry/parent_static/symbol_members.rs
  • crates/perry-runtime/src/snap_image/tests.rs
  • crates/perry-wpfacts/src/tests/an11.rs
  • crates/perry-wpfacts/src/tests/an8.rs
Files with no reviewable changes: 1

  • crates/perry-wpfacts/src/tests/an8.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@TheHypnoo TheHypnoo added area:tooling-ci CLI driver, scripts, CI, release effort:S Hours: one local fix impact:high Common programs break, platform or CI blocked type:chore Refactor, CI, docs, cleanup labels Nov 18, 2026
ralic and others added 2 commits November 18, 2026 21:16
The warnings job's all-targets check (`RUSTFLAGS="-D warnings" cargo check
--workspace --all-targets ...`) fails on main 028b066 in test code:

- perry-runtime, Linux x86_64 (snap_image tests compile only there):
  snap_image/tests.rs:607 and :618 cast the fn item `registry_probe_init`
  straight to `usize` (`function_casts_as_integer`, from 3fff06c); they
  go through `*const ()` first, as the rest of perry-runtime does.
- perry-runtime: class_registry/parent_static/symbol_members.rs:334 wraps
  the `js_put_value_set_dynamic` call in an `unsafe` block inside the
  test's own `unsafe` block (`unused_unsafe`, from 2060ef8).
- perry-wpfacts: tests/an8.rs carries `copies_builtin_fn` and `ADD_I`
  that no test calls (314d80d), and tests/an11.rs another unused
  `copies_builtin_fn` (1fcff16); they are deleted, and an11's
  `TmplKind` import, which only that helper used.

Measured: `RUSTFLAGS="-D warnings" cargo check -p perry-runtime
-p perry-stdlib --lib --tests --target x86_64-unknown-linux-gnu` and
`RUSTFLAGS="-D warnings" cargo check -p perry-wpfacts --lib --tests`
both fail on main and finish on this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
@TheHypnoo
TheHypnoo force-pushed the fix/main-red-test-warnings branch from b0a884c to 7de590c Compare November 18, 2026 20:17
@TheHypnoo
TheHypnoo merged commit 925dde1 into PerryTS:main Nov 18, 2026
6 checks passed
@raliclo
raliclo deleted the fix/main-red-test-warnings branch November 18, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tooling-ci CLI driver, scripts, CI, release effort:S Hours: one local fix impact:high Common programs break, platform or CI blocked type:chore Refactor, CI, docs, cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants