]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #14768 : riccieri/rust/detransmute-arena, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 11 Jun 2014 01:07:07 +0000 (18:07 -0700)
committerbors <bors@rust-lang.org>
Wed, 11 Jun 2014 01:07:07 +0000 (18:07 -0700)
**Update**

I've reimplemented this using `Cell` and `RefCell`, as suggested by @alexcrichton. By taking care with the duration of the borrows, I was able to maintain the recursive allocation feature (now covered by a test) without the use of `Unsafe`, and without breaking the non-aliasing `&mut` invariant.

**Original**

Changes both `Arena` and `TypedArena` to contain an inner struct wrapped in a `Unsafe`, and change field access to go through those instead of transmuting `&self` to `&mut self`.

Part of #13933


Trivial merge