]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #23312 - gkoz:ptr_from_box_docs, r=steveklabnik
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 13 Mar 2015 12:41:34 +0000 (18:11 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 13 Mar 2015 12:41:34 +0000 (18:11 +0530)
 Show how to get a pointer without destroying the box.
Use `boxed::into_raw` instead of `mem::transmute`.

I removed the `let my_num: *const i32 = mem::transmute(my_num);` case altogether because we own the box, a `*mut` pointer is good anywhere a `*const` is needed, `from_raw` takes a mutable pointer and casting from a `*const` caused an ICE.


Trivial merge