Skip to content

Comments

feat(allocator/vec): add Vec::into_bump_slice method#15770

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-17-feat_allocator_vec_add_vec_into_bump_slice_method
Nov 17, 2025
Merged

feat(allocator/vec): add Vec::into_bump_slice method#15770
graphite-app[bot] merged 1 commit intomainfrom
11-17-feat_allocator_vec_add_vec_into_bump_slice_method

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Nov 17, 2025

Add an into_bump_slice method in Vec that directly delegates to the InnerVec's into_bump_slice. The reason we should add this method rather than using InnerVec's into_bump_slice directly is that the method requires taking self, which doesn't work with Deref.

The method comments are copied from InnerVec's, and the example has been changed to make it work with the current Vec.

Copilot AI review requested due to automatic review settings November 17, 2025 08:30
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Nov 17, 2025
Copy link
Member Author

Dunqing commented Nov 17, 2025


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 hot fixes, skip the queue and merge this PR next

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.

Copy link
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

This PR adds a new into_bump_slice method to the Vec type, which converts a Vec<T> into a borrowed slice &'alloc [T]. This provides a convenient way to convert arena-allocated vectors into slices with the same lifetime as the allocator.

Key Changes:

  • Added Vec::into_bump_slice method that delegates to the underlying InnerVec implementation
  • Included documentation with usage example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 17, 2025

CodSpeed Performance Report

Merging #15770 will not alter performance

Comparing 11-17-feat_allocator_vec_add_vec_into_bump_slice_method (be713e8) with main (bf20cf5)

Summary

✅ 37 untouched

@Dunqing Dunqing force-pushed the 11-17-feat_allocator_vec_add_vec_into_bump_slice_method branch from e9f5987 to be713e8 Compare November 17, 2025 08:50
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
Copy link
Member

overlookmotel commented Nov 17, 2025

Merge activity

Add an `into_bump_slice` method in `Vec` that directly delegates to the InnerVec's `into_bump_slice`. The reason we should add this method rather than using `InnerVec`'s `into_bump_slice` directly is that the method requires taking `self`, which doesn't work with `Deref`.

The method comments are copied from InnerVec's, and the example has been changed to make it work with the current Vec.
@graphite-app graphite-app bot force-pushed the 11-17-feat_allocator_vec_add_vec_into_bump_slice_method branch from be713e8 to 102365d Compare November 17, 2025 13:21
@graphite-app graphite-app bot merged commit 102365d into main Nov 17, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 11-17-feat_allocator_vec_add_vec_into_bump_slice_method branch November 17, 2025 13:27
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
overlookmotel pushed a commit that referenced this pull request Nov 24, 2025
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (#15781)
(overlookmotel)

Co-authored-by: Boshen <[email protected]>
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…5770)

Add an `into_bump_slice` method in `Vec` that directly delegates to the InnerVec's `into_bump_slice`. The reason we should add this method rather than using `InnerVec`'s `into_bump_slice` directly is that the method requires taking `self`, which doesn't work with `Deref`.

The method comments are copied from InnerVec's, and the example has been changed to make it work with the current Vec.
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (oxc-project#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (oxc-project#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (oxc-project#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (oxc-project#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (oxc-project#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (oxc-project#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (oxc-project#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (oxc-project#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (oxc-project#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(oxc-project#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (oxc-project#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (oxc-project#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (oxc-project#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (oxc-project#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (oxc-project#15781)
(overlookmotel)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants