Skip to content

refactor(allocator): fix unsafe_op_in_unsafe_fn clippy warnings#21238

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/04-09-refactor_allocator_fix_unsafe_op_in_unsafe_fn_clippy_warnings
Apr 9, 2026
Merged

refactor(allocator): fix unsafe_op_in_unsafe_fn clippy warnings#21238
graphite-app[bot] merged 1 commit into
mainfrom
om/04-09-refactor_allocator_fix_unsafe_op_in_unsafe_fn_clippy_warnings

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Apr 9, 2026

Copy link
Copy Markdown
Member

Continuation of #21231.

overlookmotel commented Apr 9, 2026

Copy link
Copy Markdown
Member Author

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
@overlookmotel overlookmotel self-assigned this Apr 9, 2026
@overlookmotel
overlookmotel marked this pull request as ready for review April 9, 2026 10:21
Copilot AI review requested due to automatic review settings April 9, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors bumpalo_alloc.rs to address Rust/Clippy’s unsafe_op_in_unsafe_fn expectations by making unsafe operations explicit via unsafe { ... } blocks, allowing removal of the file-level unsafe_op_in_unsafe_fn expectation.

Changes:

  • Removed unsafe_op_in_unsafe_fn from the crate-level #![expect(...)] list.
  • Wrapped calls to unsafe trait methods (alloc, realloc, dealloc, grow_in_place, shrink_in_place) in explicit unsafe blocks within unsafe fn default implementations.
  • Wrapped unsafe core operations (Layout::from_size_align_unchecked, ptr::copy_nonoverlapping, ptr::write_bytes) in explicit unsafe blocks.

@codspeed-hq

codspeed-hq Bot commented Apr 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-09-refactor_allocator_fix_unsafe_op_in_unsafe_fn_clippy_warnings (5770c68) with om/04-09-refactor_allocator_fix_unused_self_clippy_warnings (64491c8)

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.

@graphite-app

graphite-app Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Merge activity

@graphite-app
graphite-app Bot force-pushed the om/04-09-refactor_allocator_fix_unused_self_clippy_warnings branch from b7baf81 to 64491c8 Compare April 9, 2026 13:17
@graphite-app
graphite-app Bot force-pushed the om/04-09-refactor_allocator_fix_unsafe_op_in_unsafe_fn_clippy_warnings branch from fed13ce to 5770c68 Compare April 9, 2026 13:18
Base automatically changed from om/04-09-refactor_allocator_fix_unused_self_clippy_warnings to main April 9, 2026 13:29
@graphite-app
graphite-app Bot merged commit 5770c68 into main Apr 9, 2026
37 checks passed
@graphite-app
graphite-app Bot deleted the om/04-09-refactor_allocator_fix_unsafe_op_in_unsafe_fn_clippy_warnings branch April 9, 2026 13:30
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