Skip to content

refactor(allocator): fix cast_sign_loss clippy warnings#21224

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

refactor(allocator): fix cast_sign_loss clippy warnings#21224
graphite-app[bot] merged 1 commit intomainfrom
om/04-08-refactor_allocator_fix_cast_sign_loss_clippy_warnings

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 9, 2026

Continuation of #21210.

Move an #[expect(clippy::cast_sign_loss)]attribute from blanket exclusion to a focused one at the location where this rule needs to be disabled, and add the reason why it's safe to ignore.

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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 9, 2026

Merging this PR will improve performance by 3.13%

⚡ 1 improved benchmark
✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation mangler[RadixUIAdoptionSection.jsx_keep_names] 20.2 µs 19.6 µs +3.13%

Comparing om/04-08-refactor_allocator_fix_cast_sign_loss_clippy_warnings (145930f) with om/04-08-refactor_allocator_fix_cast_ptr_alignment_clippy_warnings (9e58ecb)

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:36
Copilot AI review requested due to automatic review settings April 9, 2026 08:36
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 crates/oxc_allocator’s bump allocator implementation to address Clippy’s cast_sign_loss warning by scoping the lint suppression to the single, justified cast site instead of a file-wide blanket suppression.

Changes:

  • Remove clippy::cast_sign_loss from the file-level #![expect(...)] list.
  • Add a targeted #[expect(clippy::cast_sign_loss, reason = ...)] on the specific offset_from(..) as usize cast in ChunkFooter::as_raw_parts.

@overlookmotel overlookmotel self-assigned this Apr 9, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 9, 2026

Merge activity

Continuation of #21210.

Move an `#[expect(clippy::cast_sign_loss)]`attribute from blanket exclusion to a focused one at the location where this rule needs to be disabled, and add the reason why it's safe to ignore.
@graphite-app graphite-app Bot force-pushed the om/04-08-refactor_allocator_fix_cast_ptr_alignment_clippy_warnings branch from d449b29 to 9e58ecb Compare April 9, 2026 08:53
@graphite-app graphite-app Bot force-pushed the om/04-08-refactor_allocator_fix_cast_sign_loss_clippy_warnings branch from 4276ffe to 145930f Compare April 9, 2026 08:53
Base automatically changed from om/04-08-refactor_allocator_fix_cast_ptr_alignment_clippy_warnings to main April 9, 2026 09:17
@graphite-app graphite-app Bot merged commit 145930f into main Apr 9, 2026
37 checks passed
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