refactor(allocator): fix lifetimes clippy warnings#21210
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 9, 2026
Merged
refactor(allocator): fix lifetimes clippy warnings#21210graphite-app[bot] merged 1 commit intomainfrom
graphite-app[bot] merged 1 commit intomainfrom
Conversation
Member
Author
This was referenced Apr 9, 2026
This was referenced Apr 9, 2026
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the allocator refactor by addressing Clippy’s elidable_lifetime_names / needless_lifetimes warnings in oxc_allocator’s bump.rs, allowing the corresponding #![expect(clippy::...)] entries to be removed.
Changes:
- Removed
clippy::elidable_lifetime_namesandclippy::needless_lifetimesfrom the file-level#![expect(...)]list. - Updated trait impl headers to use elided/anonymous lifetimes where appropriate (
ChunkIter’sFusedIterator, andAlloc/Allocatorimpls for&Bump).
Contributor
Merge activity
|
`bump.rs` was copied directly from `bumpalo`. `bumpalo` supports much older Rust versions than Oxc does, so uses patterns which are flagged by Clippy in more recent versions. #20963 silenced these clippy errors/warnings with a large `#[expect]` block at the top of the file. This stack of PRs fixes these warnings and removes the `#[expect(clippy:...)]` comments. All PRs in this stack were generated by Claude. I had him split them into 1 PR per clippy rule so that I could review each in isolation - some of the changes, especially around pointers, are quite subtlle.
85644c8 to
1c9245a
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
) Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210. Use `NonNull::from_ref` to construct self-pointing pointers in `EMPTY_CHUNK`. This removes some `unsafe` code.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210. Replace `x as *const T` / `x as *mut T` with `ptr::from_ref(x)` / `ptr::from_mut(x)`. Note that this change does not materialize any references which did not already exist in original code.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210. Replace `ptr as *const u8` / `ptr as *mut u8` with `ptr.cast::<u8>()`. The constness of pointers is not altered by this change.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210. Replace `ptr as *const T` / `ptr as *mut T` with `ptr.cast_const()` / `ptr.cast_mut()`. This reveals one dodgy `const` to `mut` conversion in `ChunkRawIter`, which I'll address in a later PR.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Continuation of #21210. Move an `#[expect(clippy::cast_ptr_alignment)]`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 bot
pushed a commit
that referenced
this pull request
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.
This was referenced Apr 9, 2026
graphite-app bot
pushed a commit
that referenced
this pull request
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.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
…21231) Same as stack starting at #21210. `bumpalo_alloc.rs` was copied directly from `bumpalo`. `bumpalo` supports much older Rust versions than Oxc does, so uses patterns which are flagged by Clippy in more recent versions. #20963 silenced these clippy errors/warnings with a large `#[expect]` block at the top of the file. This stack of PRs fixes these warnings and removes the `#[expect(clippy:...)]` comments. All PRs in this stack were generated by Claude. I had him split them into 1 PR per clippy rule so that I could review each in isolation - some of the changes, especially around pointers, are quite subtlle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

bump.rswas copied directly frombumpalo.bumpalosupports much older Rust versions than Oxc does, so uses patterns which are flagged by Clippy in more recent versions. #20963 silenced these clippy errors/warnings with a large#[expect]block at the top of the file.This stack of PRs fixes these warnings and removes the
#[expect(clippy:...)]comments. All PRs in this stack were generated by Claude. I had him split them into 1 PR per clippy rule so that I could review each in isolation - some of the changes, especially around pointers, are quite subtlle.