mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
feat(allocator): make Box's PhantomData own the passed in T (#2952)
This commit is contained in:
parent
e651e50bda
commit
063b281c39
2 changed files with 3 additions and 1 deletions
2
.github/workflows/miri.yml
vendored
2
.github/workflows/miri.yml
vendored
|
|
@ -6,12 +6,14 @@ on:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
paths:
|
paths:
|
||||||
- 'crates/oxc_parser/**'
|
- 'crates/oxc_parser/**'
|
||||||
|
- 'crates/oxc_allocator/**'
|
||||||
- '.github/workflows/miri.yml'
|
- '.github/workflows/miri.yml'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'crates/oxc_parser/**'
|
- 'crates/oxc_parser/**'
|
||||||
|
- 'crates/oxc_allocator/**'
|
||||||
- '.github/workflows/miri.yml'
|
- '.github/workflows/miri.yml'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ use crate::Allocator;
|
||||||
/// A Box without Drop.
|
/// A Box without Drop.
|
||||||
/// This is used for over coming self-referential structs.
|
/// This is used for over coming self-referential structs.
|
||||||
/// It is a memory leak if the boxed value has a `Drop` implementation.
|
/// It is a memory leak if the boxed value has a `Drop` implementation.
|
||||||
pub struct Box<'alloc, T: ?Sized>(NonNull<T>, PhantomData<&'alloc T>);
|
pub struct Box<'alloc, T: ?Sized>(NonNull<T>, PhantomData<(&'alloc (), T)>);
|
||||||
|
|
||||||
impl<'alloc, T> Box<'alloc, T> {
|
impl<'alloc, T> Box<'alloc, T> {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue