refactor(allocator): add #[repr(transparent)] to Vec and Box#13457
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
CodSpeed Instrumentation Performance ReportMerging #13457 will not alter performanceComparing Summary
Footnotes
|
#[repr(transparent)] to Vec and Box#[repr(transparent)] to Vec and Box
There was a problem hiding this comment.
Pull Request Overview
This refactor adds #[repr(transparent)] attributes to the Vec and Box structs in the allocator crate to ensure they have the same memory layout as their wrapped types.
- Adds
#[repr(transparent)]toVec<'alloc, T>wrapper struct - Adds
#[repr(transparent)]toBox<'alloc, T>wrapper struct
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_allocator/src/vec.rs | Adds transparent representation to Vec wrapper |
| crates/oxc_allocator/src/boxed.rs | Adds transparent representation to Box wrapper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
…13457) Both these structs are just wrappers around another type. Best to put `#[repr(transparent)]` on them.
b90eae6 to
e6cdaa6
Compare

Both these structs are just wrappers around another type. Best to put
#[repr(transparent)]on them.