Skip to content

Fix clippy function-casts-as-integer warnings in sys-test#52

Merged
Brooooooklyn merged 1 commit intomainfrom
claude/fix-clippy-issues
Apr 16, 2026
Merged

Fix clippy function-casts-as-integer warnings in sys-test#52
Brooooooklyn merged 1 commit intomainfrom
claude/fix-clippy-issues

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 16, 2026

CI clippy fails with -D warnings due to 93 instances of direct function-to-integer casts in ctest2-generated FFI test code.

Changes

  • Added function_casts_as_integer to the lint allow list in libmimalloc-sys/sys-test/src/main.rs

The warnings occur in auto-generated code that performs fn_name as usize casts for FFI pointer validation. Since this is test-only generated code and the casts are safe in context, suppressing the lint is appropriate.

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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Brooooooklyn Brooooooklyn merged commit 0eba609 into main Apr 16, 2026
19 checks passed
@Brooooooklyn Brooooooklyn deleted the claude/fix-clippy-issues branch April 16, 2026 08:06
This was referenced Apr 16, 2026
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.

2 participants