Fix clippy function-casts-as-integer warnings in sys-test#52
Fix clippy function-casts-as-integer warnings in sys-test#52Brooooooklyn merged 1 commit intomainfrom
Conversation
This fixes clippy warnings when running with -D warnings flag. The warnings were occurring in ctest2-generated code which performs direct casts of function items to integers. Added the allow attribute to suppress these warnings in the test code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Brooooooklyn <3468483+Brooooooklyn@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8004a177bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,4 +1,4 @@ | |||
| #![allow(bad_style, clippy::all)] | |||
| #![allow(bad_style, clippy::all, function_casts_as_integer)] | |||
There was a problem hiding this comment.
Remove unsupported lint allow from sys-test crate
function_casts_as_integer is not a recognized stable Rust lint (on stable toolchains it is emitted as unknown lint), so adding it here introduces a new warning that becomes an error under the repository’s Clippy invocation cargo clippy --workspace -- -D warnings in .github/workflows/ci.yml (line 92). In practice this causes the lint job to fail with -D unknown-lints before the generated-code warnings are addressed.
Useful? React with 👍 / 👎.
CI clippy fails with
-D warningsdue to 93 instances of direct function-to-integer casts inctest2-generated FFI test code.Changes
function_casts_as_integerto the lint allow list inlibmimalloc-sys/sys-test/src/main.rsThe warnings occur in auto-generated code that performs
fn_name as usizecasts for FFI pointer validation. Since this is test-only generated code and the casts are safe in context, suppressing the lint is appropriate.