Skip to content

refactor(allocator): remove Layout::repeat polyfill#24378

Merged
graphite-app[bot] merged 1 commit into
mainfrom
refactor-layout-repeat
Jul 12, 2026
Merged

refactor(allocator): remove Layout::repeat polyfill#24378
graphite-app[bot] merged 1 commit into
mainfrom
refactor-layout-repeat

Conversation

@Boshen

@Boshen Boshen commented Jul 11, 2026

Copy link
Copy Markdown
Member

Rust 1.95 stabilized Layout::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

@Boshen
Boshen requested a review from overlookmotel as a code owner July 11, 2026 10:33
@github-actions github-actions Bot added the A-allocator Area - Allocator label Jul 11, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing refactor-layout-repeat (f11eab1) with main (4a0d8dc)

Open in CodSpeed

Footnotes

  1. 9 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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 12, 2026

overlookmotel commented Jul 12, 2026

Copy link
Copy Markdown
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
graphite-app Bot force-pushed the refactor-layout-repeat branch from f11eab1 to d678236 Compare July 12, 2026 01:06
@graphite-app
graphite-app Bot merged commit d678236 into main Jul 12, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 12, 2026
@graphite-app
graphite-app Bot deleted the refactor-layout-repeat branch July 12, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants