Repository navigation
fix: the -D warnings errors in perry-runtime's and perry-wpfacts' tests - #14871
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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
b0a884c to
7de590c
Compare
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
unsafein 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 theunsafeblock nested in the test's ownunsafe(unused_unsafe; from 2060ef8).crates/perry-wpfacts/src/tests/an8.rs: delete the uncalledcopies_builtin_fnandADD_I(314d80d);tests/an11.rs: delete the uncalledcopies_builtin_fn(1fcff16) and theTmplKindimport 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 → FinishedRUSTFLAGS="-D warnings" cargo check -p perry-wpfacts --lib --tests: main →copies_builtin_fn×2 /ADD_Inever used; branch → Finishedcargo 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 newBASE_SHA=upstream/main bash scripts/run_lint_gates.shon 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.dfragment added🤖 Generated with Claude Code
https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Summary by CodeRabbit