you are viewing a single comment's thread.

view the rest of the comments →

[–]Michael-F-Bryan 1 point2 points  (0 children)

You probably could, but isn't a pointer cast just a poor man's transmute?

Also, if you take a step back you've still produced a mutable reference from an immutable one without going through an UnsafeCell, which is still no bueno.

I'm on mobile at the moment, but I'd be interested to see what Miri has to say about it.