@Matthew Jasper Is there any way to turn a
&mut into a
*mut without incurring a reborrow or an intermediate assignment? I am rewriting parts of Stacked Borrows, also to hopefully fix the problems you ran into when implementing the "take a raw ref" operator, but sometimes it is just impossible to even generate the MIR that I'd like to test.
I don't think so, the way that we generate the cast means that there has to be a reborrow.
Dang. Well I guess that means we'll have to be creative when that is finally possible, and write the necessary tests then. Would be much easier now when everything is still fresh^^
I don't know exactly the details, but i heard that it is defined behavior to first wrap the &mut with
Some then transmute it to a
*mut. Does that involve a reborrow or an intermediate assignment?
the transmute unfortunately does not have all the effects of a cast
and it is the cast that I wanted to study here
(also, no need to wrap it in
Some, you can just transmute
*mut -- but a cast is pretty much always preferred)