We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to this doc page http://doc.rust-lang.org/1.0.0-beta/std/cell/struct.UnsafeCell.html, transmuting &T to &mut T is undefined behavior. I believe rustc tells llvm they are readonly unless the unsafe lang item is used, which is UnsafeCell.
The text was updated successfully, but these errors were encountered:
Hmmm.... so what about transmuting *mut T -> &mut T, is that permitted? Should PoolInner be wrapped in an UnsafeCell?
*mut T
&mut T
PoolInner
UnsafeCell
Sorry, something went wrong.
I do not know if that's safe. However, you can easily do let a = &mut *ptr; to get &mut T from a *mut T.
let a = &mut *ptr;
Finally filed that PR for a lint as well: rust-lang/rust#24392
7dce7bf
No branches or pull requests
According to this doc page http://doc.rust-lang.org/1.0.0-beta/std/cell/struct.UnsafeCell.html, transmuting &T to &mut T is undefined behavior. I believe rustc tells llvm they are readonly unless the unsafe lang item is used, which is UnsafeCell.
The text was updated successfully, but these errors were encountered: