mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32: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]
|
||||
paths:
|
||||
- 'crates/oxc_parser/**'
|
||||
- 'crates/oxc_allocator/**'
|
||||
- '.github/workflows/miri.yml'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'crates/oxc_parser/**'
|
||||
- 'crates/oxc_allocator/**'
|
||||
- '.github/workflows/miri.yml'
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use crate::Allocator;
|
|||
/// A Box without Drop.
|
||||
/// This is used for over coming self-referential structs.
|
||||
/// 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> {
|
||||
#[allow(unsafe_code)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue