News for hackers. Stuff that matters.
Re:Announcing Rust 1.3 by vvanders on Thursday September 17, 2015 @02:01PM (#10235018)
Nice to see them plugging along.

I don't know where it is on the stabilization timeline but it would be nice to see the ability to move a heap value out of a Box<T> without using the stable APIs.

I've a few use cases where another languages is calling Rust and I want to return an allocated struct over FFI but std::mem::transmute(Box<T>) has a size mismatch and std::boxed::from_raw/into_raw are unstable.

Re:Announcing Rust 1.3 by kzrdude on Thursday September 17, 2015 @02:07PM (#10235069)
Take a short snippet of your code pastebin it, bring your question to #rust and we'll help you quickly.

FYI, Box::into_raw will be stable in Rust 1.4, next release.

Re:Announcing Rust 1.3 by vvanders on Thursday September 17, 2015 @02:07PM (#10235075)
Nice! That's what I was wondering :)
Re:Announcing Rust 1.3 by gkoz on Thursday September 17, 2015 @04:17PM (#10235792)
> std::mem::transmute(Box<T>) has a size mismatch

This sounds like trying to fit a fat pointer in a regular one. into_raw won't help with that.

Re:Announcing Rust 1.3 by steveklabnik on Thursday September 17, 2015 @02:04PM (#10235043)
Who is allocating, Rust or the other language?
Re:Announcing Rust 1.3 by vvanders on Thursday September 17, 2015 @02:10PM (#10235098)
Rust is both allocating and deallocating. With the case of using Rust like a library we don't know the lifetime(since it's owned by the calling language) so rather than stuffing it in a 'static context and use some sort if ID for lookup in the API I'd rather just return the raw struct.
Re:Announcing Rust 1.3 by steveklabnik on Thursday September 17, 2015 @02:16PM (#10235129)
Yeah, in that case, just waiting for the next release is best. You can do some `transmute` shenanigans in the meantime, but since it's coming so soon, might as well just wait.