refactor(allocator): remove Layout::repeat polyfill#24378
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Member
Merge activity
|
Rust 1.95 stabilized [`Layout::repeat`](https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.repeat) (MSRV bumped in #24359), which the `UnstableLayoutMethods` polyfill trait in `bumpalo_alloc.rs` was waiting on (per its TODO comment). It turns out the whole trait is deletable rather than just replaceable: - The only `.repeat()` call outside the trait itself (`vec2/raw_vec.rs`) is inside a commented-out block. - The live `Layout::array::<T>(n)` calls already resolve to the inherent std method (stable since 1.44), not the trait method. - `padding_needed_for` was only used by the trait's own `repeat` impl. Also drops the two `#![allow(unstable_name_collisions)]` attributes, which only existed because the trait methods collided with the then-unstable std inherent methods. Net: -59 lines, no behavior change. `cargo check/clippy/test -p oxc_allocator` all clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
graphite-app
Bot
force-pushed
the
refactor-layout-repeat
branch
from
July 12, 2026 01:06
f11eab1 to
d678236
Compare
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.
Rust 1.95 stabilized
Layout::repeat(MSRV bumped in #24359), which theUnstableLayoutMethodspolyfill trait inbumpalo_alloc.rswas waiting on (per its TODO comment).It turns out the whole trait is deletable rather than just replaceable:
.repeat()call outside the trait itself (vec2/raw_vec.rs) is inside a commented-out block.Layout::array::<T>(n)calls already resolve to the inherent std method (stable since 1.44), not the trait method.padding_needed_forwas only used by the trait's ownrepeatimpl.Also drops the two
#![allow(unstable_name_collisions)]attributes, which only existed because the trait methods collided with the then-unstable std inherent methods.Net: -59 lines, no behavior change.
cargo check/clippy/test -p oxc_allocatorall clean.🤖 Generated with Claude Code