You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of this discussion, it seems we have general consensus that "it is acceptable to write bytes through a pointer derived from &mut T even if those bytes make the T invalid so long as the T is made valid again before the lifetime that would be given to the pointer if it were a reference expires and the parent &mut T is usable again."
Specifically, this is fine:
fnmain(){letmut b = false;let ptr = &mut b as*mutboolas*mutu8;unsafe{*ptr = 2;*ptr -= 1;}assert!(b);}
We should probably document this as UCG consensus, and maybe even find a way to get t-lang to sign off on this, though it seems unclear how to best do that.
This is helpful because it means the code in rust-lang/rfcs#2195 is fine without having to weaken the notion of validity of those enums specifically.
The text was updated successfully, but these errors were encountered:
As part of this discussion, it seems we have general consensus that "it is acceptable to write bytes through a pointer derived from &mut T even if those bytes make the T invalid so long as the T is made valid again before the lifetime that would be given to the pointer if it were a reference expires and the parent &mut T is usable again."
Specifically, this is fine:
We should probably document this as UCG consensus, and maybe even find a way to get t-lang to sign off on this, though it seems unclear how to best do that.
This is helpful because it means the code in rust-lang/rfcs#2195 is fine without having to weaken the notion of validity of those enums specifically.
The text was updated successfully, but these errors were encountered: