]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7986 : alexcrichton/rust/raw-repr, r=brson
authorbors <bors@rust-lang.org>
Sat, 27 Jul 2013 02:46:36 +0000 (19:46 -0700)
committerbors <bors@rust-lang.org>
Sat, 27 Jul 2013 02:46:36 +0000 (19:46 -0700)
This moves the raw struct layout of closures, vectors, boxes, and strings into a
new `unstable::raw` module. This is meant to be a centralized location to find
information for the layout of these values.

As safe method, `unwrap`, is provided to convert a rust value to its raw
representation. Unsafe methods to convert back are not provided because they are
rarely used and too numerous to write an implementation for each (not much of a
common pattern).

This is progress on #6790. I tried to get a nice interface for a trait to implement in the raw module, but I was unable to come up with one. The hard part is that there are so many different directions to go from one way to another that it's difficult to find a pattern to follow to implement a trait with. Someone else might have some better luck though.


Trivial merge