Skip to content

clippy iter_over_hash_type#8182

Open
ShaharNaveh wants to merge 1 commit into
RustPython:mainfrom
ShaharNaveh:iter-over-hashtype
Open

clippy iter_over_hash_type#8182
ShaharNaveh wants to merge 1 commit into
RustPython:mainfrom
ShaharNaveh:iter-over-hashtype

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Summary by CodeRabbit

  • Chores
    • Added a new lint warning for iterating over hash-based collections.
    • Marked several existing iteration points to acknowledge that order does not matter, keeping the codebase lint-clean.
    • No user-facing behavior, performance, or API changes were introduced.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: aa7601d7-9cfe-4a2d-9193-308f2304b4b8

📥 Commits

Reviewing files that changed from the base of the PR and between 0009dd6 and 4418a0d.

📒 Files selected for processing (6)
  • Cargo.toml
  • crates/derive-impl/src/pyclass.rs
  • crates/stdlib/src/faulthandler.rs
  • crates/vm/src/builtins/frame.rs
  • crates/vm/src/gc_state.rs
  • crates/vm/src/vm/mod.rs

📝 Walkthrough

Walkthrough

The workspace lint set now warns on iter_over_hash_type, and several hash-map iteration sites in derive-impl, stdlib, and vm add matching #[expect(...)] annotations. No runtime control flow changes were introduced.

Changes

Clippy iter_over_hash_type rollout

Layer / File(s) Summary
Workspace lint warning
Cargo.toml
Adds iter_over_hash_type = "warn" under [workspace.lints.rust].
Derive-impl validation loops
crates/derive-impl/src/pyclass.rs
Adds #[expect(clippy::iter_over_hash_type, reason = "Iteration order doesn't matter here")] before the map iterations in GetSetNursery::validate and MemberNursery::validate.
Thread registry iteration
crates/stdlib/src/faulthandler.rs, crates/vm/src/builtins/frame.rs, crates/vm/src/vm/mod.rs
Adds #[expect(clippy::iter_over_hash_type)] annotations around registry iteration in dump_all_threads, Frame::f_back, park_detached_threads, start_the_world, and the two debug assertion helpers.
GC collection loops
crates/vm/src/gc_state.rs
Adds #[expect(clippy::iter_over_hash_type)] annotations before the loops that populate gc_refs, referents_map, and reachable/worklist.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Suggested reviewers

  • youknowone

Poem

(_/)
( •_•) I hop through warnings, soft and bright,
Hash maps hum in morning light.
expect ears twitch, the loops align,
Tidy code carrots taste divine.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: addressing the Clippy iter_over_hash_type lint.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

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