Skip to content

refactor(allocator): fix mut_from_ref clippy warnings#21225

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings
Apr 9, 2026
Merged

refactor(allocator): fix mut_from_ref clippy warnings#21225
graphite-app[bot] merged 1 commit intomainfrom
om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 9, 2026

Continuation of #21210.

Remove #[expect(clippy::mut_from_ref)]attribute from top level, and add it on all methods which take an immutable &self and return a &mut reference. This usually-unsound pattern is sound here as Bump uses interior mutability.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 9, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Apr 9, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 9, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings (40016e5) with main (145930f)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel marked this pull request as ready for review April 9, 2026 08:38
Copilot AI review requested due to automatic review settings April 9, 2026 08:38
@overlookmotel overlookmotel self-assigned this Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors Bump’s Clippy lint suppression for clippy::mut_from_ref by removing the module-level suppression and scoping it to specific methods that return &mut from &self.

Changes:

  • Removed clippy::mut_from_ref from the crate-level #![expect(...)] list in bump.rs.
  • Added #[expect(clippy::mut_from_ref)] to a set of Bump allocation helpers that return mutable references from &self.

@graphite-app graphite-app bot changed the base branch from om/04-08-refactor_allocator_fix_cast_sign_loss_clippy_warnings to graphite-base/21225 April 9, 2026 08:53
@graphite-app graphite-app bot force-pushed the om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings branch from cb28ef1 to 02c7f8e Compare April 9, 2026 09:19
@graphite-app graphite-app bot force-pushed the graphite-base/21225 branch from 4276ffe to 145930f Compare April 9, 2026 09:19
@graphite-app graphite-app bot changed the base branch from graphite-base/21225 to main April 9, 2026 09:20
@graphite-app graphite-app bot force-pushed the om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings branch from 02c7f8e to adb6b3e Compare April 9, 2026 09:20
@overlookmotel overlookmotel force-pushed the om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings branch from adb6b3e to 40016e5 Compare April 9, 2026 09:46
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Apr 9, 2026

Merge activity

Continuation of #21210.

Remove `#[expect(clippy::mut_from_ref)]`attribute from top level, and add it on all methods which take an immutable `&self` and return a `&mut` reference. This usually-unsound pattern is sound here as `Bump` uses interior mutability.
@graphite-app graphite-app bot force-pushed the om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings branch from 40016e5 to 52db8a7 Compare April 9, 2026 10:05
@graphite-app graphite-app bot merged commit 52db8a7 into main Apr 9, 2026
27 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 9, 2026
@graphite-app graphite-app bot deleted the om/04-08-refactor_allocator_fix_mut_from_ref_clippy_warnings branch April 9, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants