Skip to content

chore: fix compile warnings#4988

Open
NathanFlurry wants to merge 1 commit into05-05-fix_compile_wasm_vs_native_features_with_custom_cfg_to_prevent_dupe_featuresfrom
05-05-chore_fix_compile_warnings
Open

chore: fix compile warnings#4988
NathanFlurry wants to merge 1 commit into05-05-fix_compile_wasm_vs_native_features_with_custom_cfg_to_prevent_dupe_featuresfrom
05-05-chore_fix_compile_warnings

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 6, 2026

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 6, 2026

Code Review

Overview

This PR fixes compile warnings across three packages by: (1) adding explicit unsafe {} blocks inside unsafe extern "C" functions in the SQLite VFS, (2) removing dead-code helper functions from pegboard-runner tests, (3) dropping unused outcome/old/new fields from rivetkit-core tracing test helpers, and (4) adding replay.scenario to chaos test failure context strings.


engine/packages/depot-client/src/vfs.rs — Explicit unsafe blocks

The pattern change from:

unsafe extern "C" fn io_close(...) -> c_int {
    vfs_catch_unwind!(SQLITE_IOERR, { ... })
}

to:

unsafe extern "C" fn io_close(...) -> c_int {
    vfs_catch_unwind!(SQLITE_IOERR, unsafe { ... })
}

This is correct for Rust 2024 edition compliance, where the body of an unsafe fn no longer implicitly grants unsafety — you need explicit unsafe {} blocks. The vfs_catch_unwind! macro takes $body:expr, and unsafe { ... } is a valid expression, so the macro expansion is semantically equivalent to before.

The three standalone helper functions (get_aux_state, get_file, get_vfs_ctx) now wrap their single dereference in an unsafe {} block inside an unsafe fn. This is consistent with the 2024 pattern and correct.


engine/packages/depot-client/tests/inline/fault/chaos.rs — Scenario name in failure context

// Before:
"seed {seed:016x} checkpoint={checkpoint} {reason}; workload={:?}; replay={:?}"

// After:
"scenario={} seed {seed:016x} checkpoint={checkpoint} {reason}; workload={:?}; replay={:?}"

Good addition. FaultScenarioReplayRecord::scenario is a String, so the {} format specifier is correct. This makes replay failure output much more actionable by identifying which named scenario failed.


engine/packages/pegboard-runner/tests/support/ws_to_tunnel_task.rs — Dead code removal

Removes six helper functions (response_start_message_mk1/mk2, response_start_message_mk1/mk2_with_stream, response_chunk_message_mk1/mk2) that are no longer called by any test in the file. Confirmed no references remain. Clean removal.

Per CLAUDE.md, the deprecated pegboard-runner path should not receive new features or bug fixes, so removing dead code here is the right call.


rivetkit-rust/packages/rivetkit-core/tests/task.rs — Dead field removal

Drops outcome, old, and new fields from MessageVisitor and CapturedLog structs used in tracing assertions. Confirmed these fields are not referenced elsewhere in the test. The live outcome variable at line 3428 is a local variable in an unrelated context.


Summary

  • Correctness: All changes are correct. The unsafe {} scoping is the right fix for the Rust 2024 edition warning.
  • No regressions: Dead-code removals have no remaining callers. Field removals are safe.
  • Test coverage: No new tests needed — this is purely a warning fix and dead-code cleanup.
  • Security: No concerns. The unsafe surface in vfs.rs is unchanged in semantics.
  • Style: Consistent with project conventions.

LGTM once it moves out of draft.

@NathanFlurry NathanFlurry marked this pull request as ready for review May 7, 2026 03:55
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