Skip to content

Commit 2bcf3a4

Browse files
committed
Fallout: arena needs to use phantomdata since invariantlifetime is gone
1 parent 8dbdcdb commit 2bcf3a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libarena/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub struct Arena<'longer_than_self> {
9696
head: RefCell<Chunk>,
9797
copy_head: RefCell<Chunk>,
9898
chunks: RefCell<Vec<Chunk>>,
99-
_invariant: marker::InvariantLifetime<'longer_than_self>,
99+
_marker: marker::PhantomData<*mut &'longer_than_self()>,
100100
}
101101

102102
impl<'a> Arena<'a> {
@@ -111,7 +111,7 @@ impl<'a> Arena<'a> {
111111
head: RefCell::new(chunk(initial_size, false)),
112112
copy_head: RefCell::new(chunk(initial_size, true)),
113113
chunks: RefCell::new(Vec::new()),
114-
_invariant: marker::InvariantLifetime,
114+
_marker: marker::PhantomData,
115115
}
116116
}
117117
}
@@ -361,6 +361,8 @@ pub struct TypedArena<T> {
361361
}
362362

363363
struct TypedArenaChunk<T> {
364+
marker: marker::PhantomData<T>,
365+
364366
/// Pointer to the next arena segment.
365367
next: *mut TypedArenaChunk<T>,
366368

0 commit comments

Comments
 (0)