clippy significant_drop_in_scrutinee & explicit_deref_methods#8104
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughTwo new Clippy workspace lint rules ( ChangesClippy Lint Enablement and Codebase-Wide Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
390038e to
e139075
Compare
June 14, 2026 14:18
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/common/src/format.rs (1)
900-903: ⚡ Quick winThe
explicit_deref_methodscleanup is incomplete.These remaining
.deref()call sites will keep the new workspace lint firing.
crates/common/src/format.rs#L900-L903: replaces.deref()with autoderef (s.chars(),s.to_owned()).crates/vm/src/builtins/type.rs#L338-L344: replaceself.init.deref()/self.getitem.deref()with borrowed autoderef.crates/vm/src/builtins/type.rs#L1431-L1438: replaceself.name().deref()with&self.name().🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/common/src/format.rs` around lines 900 - 903, Remove the explicit deref() calls to allow Rust's autoderef mechanism to handle the dereferencing automatically. In crates/common/src/format.rs lines 900-903, replace s.deref().chars() with s.chars() and s.deref().to_owned() with s.to_owned(). In crates/vm/src/builtins/type.rs lines 338-344, replace self.init.deref() and self.getitem.deref() with borrowed references using the autoderef operator (e.g., &self.init and &self.getitem). In crates/vm/src/builtins/type.rs lines 1431-1438, replace self.name().deref() with &self.name() to let autoderef handle the dereferencing. These changes will resolve the explicit_deref_methods lint warnings across all three affected sites.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/vm/src/object/core.rs`:
- Around line 2133-2135: Replace explicit `.deref()` and `.deref_mut()` calls
with direct deref operator syntax across multiple files to resolve clippy's
explicit_deref_methods warnings. In crates/vm/src/object/core.rs at lines
2123-2125 (first Hash impl), replace `self.deref().hash(state)` with
`(*self).hash(state)`. At lines 2133-2135 (first PartialEq impl), replace
`self.deref().eq(&**other)` with `(*self).eq(&*other)`. At lines 2399-2402
(second Hash impl), apply the same Hash pattern replacement. At lines 2410-2412
(second PartialEq impl), apply the same PartialEq pattern replacement. In
crates/vm/src/builtins/list.rs at lines 239-240 in the clear() method, replace
`self.borrow_vec_mut().deref_mut()` with `&mut *self.borrow_vec_mut()`. At lines
479-480 in the init() method, replace `zelf.borrow_vec_mut().deref_mut()` with
`&mut *zelf.borrow_vec_mut()`. After applying all changes, run cargo clippy to
verify no remaining lint warnings.
---
Nitpick comments:
In `@crates/common/src/format.rs`:
- Around line 900-903: Remove the explicit deref() calls to allow Rust's
autoderef mechanism to handle the dereferencing automatically. In
crates/common/src/format.rs lines 900-903, replace s.deref().chars() with
s.chars() and s.deref().to_owned() with s.to_owned(). In
crates/vm/src/builtins/type.rs lines 338-344, replace self.init.deref() and
self.getitem.deref() with borrowed references using the autoderef operator
(e.g., &self.init and &self.getitem). In crates/vm/src/builtins/type.rs lines
1431-1438, replace self.name().deref() with &self.name() to let autoderef handle
the dereferencing. These changes will resolve the explicit_deref_methods lint
warnings across all three affected sites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 6e31d954-9ca8-402c-b36c-34450729bb75
📒 Files selected for processing (21)
Cargo.tomlcrates/common/src/borrow.rscrates/common/src/format.rscrates/stdlib/src/_asyncio.rscrates/stdlib/src/array.rscrates/stdlib/src/ssl.rscrates/vm/src/builtins/classmethod.rscrates/vm/src/builtins/list.rscrates/vm/src/builtins/property.rscrates/vm/src/builtins/set.rscrates/vm/src/builtins/staticmethod.rscrates/vm/src/builtins/type.rscrates/vm/src/datastack.rscrates/vm/src/exceptions.rscrates/vm/src/intern.rscrates/vm/src/object/core.rscrates/vm/src/scope.rscrates/vm/src/stdlib/_ctypes/base.rscrates/vm/src/stdlib/_ctypes/pointer.rscrates/vm/src/stdlib/_thread.rscrates/vm/src/types/slot.rs
Sorry, something went wrong.
880040d
into
RustPython:main
Jun 15, 2026
Summary
Summary by CodeRabbit
Release Notes
Scope::newaconst fnfor compile-time evaluation.ALIGNusing proper link formatting.