]> git.lizzy.rs Git - rust.git/commit
Added lifetime param to Arena.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Mon, 2 Feb 2015 13:10:36 +0000 (14:10 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 11 Feb 2015 12:51:21 +0000 (13:51 +0100)
commit2c9d81b2d47d1c8d0e4c771b778238948c269c20
treee1c6b8df6d8acb7549c7306afa4503ef4cd68932
parentc1cda0793e4e7b92a73cc13ee6e4a6b14a1b633f
Added lifetime param to Arena.

It (1.) is invariant, (2.) must strictly outlive the arena itself,
(3.) constrains the inputs to the arena so that their borrows must
also strictly outlive the arena itself.

This implies that, for now, one can no longer have cross-references
between data allocated via the same `Arena` (even when the data is not
subject to the Drop Check rule).  Instead one must carry multiple
`Arena` instances, or (more commonly), use one or more `TypedArena`
instances with enums encoding the different variants of allocated
data.
src/libarena/lib.rs