Skip to content

Fix inherited main Clippy failures - #9724

Closed
youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/main-clippy-20261105
Closed

youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/main-clippy-20261105

Conversation

@youknowdot

@youknowdot youknowdot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #9725, merged into main at a2cd289056adb917e795dc9022e3086c5a05166f. All functional fixes are covered; the only remaining differences are explanatory wording and expect versus allow for the intentional POSIX snapshot.

Summary

Fix the strict Clippy failures inherited from main, without changing interpreter behavior:

  • Keep the platform-dependent cmsghdr.cmsg_len conversion and explain its narrowly scoped lint allowance.
  • Make the ancillary test module explicitly #[cfg(test)] and use equivalent alignment/range expressions, retaining every assertion.
  • Preserve the eager execve environment snapshot before Python callbacks, with an explained needless_collect expectation.
  • Use Self and inline format arguments in ElementTree.

The patch is 3 files, +13/-7. Base: 08af9f472a471a8be543529f688f15421f49532f.

Verification

  • Reproduced the unmodified main failure with the CI Clippy command (offline, one job): eight host_env diagnostics, including the platform cast and ancillary tests.
  • Fixed tree passes cargo clippy --offline --locked --keep-going -j1 --features capi,encodings,jit,sqlite,threading --workspace --all-targets --bins --examples --tests --exclude rustpython_wasm --exclude rustpython-venvlauncher -- -Dwarnings on GNU/Linux, Rust 1.99.0.
  • cargo test --offline --locked -j1 -p rustpython-host_env: 21 passed, including all five ancillary parser tests; doc tests passed.
  • Normal commit hooks passed (rustfmt, cspell, merge-conflict check).
  • Full cargo test --offline --locked -j1 --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi passed: 1,483 tests/doctests passed, 20 existing ignored, zero failures. Local environment needed a task-local linker alias for installed libffi.so.8 and disk cleanup. Debug symbols were stripped only from completed example binaries; all loadable ELF sections were verified unchanged.
  • Separate C-API validation and further CI monitoring were stopped after Fix clippy warnings on main #9725 merged all of these fixes. This PR is superseded; the only residual differences are explanatory wording and expect versus allow for the intentional POSIX snapshot.

Main's existing CI run independently reproduces the three ElementTree diagnostics on Linux, macOS, and Windows with Rust 1.99.1. This environment can run Linux only; cross-platform results will come from CI.

AI disclosure

OpenAI Codex assisted with investigation, code changes, source review, and validation. No behavior changes or test assertions were generated.

Preserve platform-dependent ancillary header conversions and the execve environment snapshot. Make the ancillary test module explicitly test-only and apply equivalent Clippy style fixes in socket tests and ElementTree.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

@youknowdot youknowdot closed this Nov 5, 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.

1 participant