]> git.lizzy.rs Git - rust.git/commit
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)
commitf92a8facf90b40a483032cedb98decc8c41bde51
treed92fd19592134de268eff55a380af07fe8cb02df
parentb1302f9c4f6619bf83fff39b305b990d8f628eb7
parent47b72e388d6f2207c977fb6b06399717bca96a77
auto merge of #14768 : riccieri/rust/detransmute-arena, r=alexcrichton

**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