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
The proposed changes to intrinsics help here, because they wlil effectively forbid transmutes between types unless we can be sure of the size, which implies that one cannot transmute arbitrary types T to U and so on. We could even make these sorts of const casts illegal -- though somehow we have to make the Unsafe type able to do it. :)
Activity
nikomatsakis commentedon Mar 26, 2014
The proposed changes to intrinsics help here, because they wlil effectively forbid transmutes between types unless we can be sure of the size, which implies that one cannot transmute arbitrary types
TtoUand so on. We could even make these sorts of const casts illegal -- though somehow we have to make theUnsafetype able to do it. :)nikomatsakis commentedon Mar 26, 2014
Oh, hmm, the RFC doesn't have the interesting parts. Nm.
emberian commentedon Mar 28, 2014
(I have this half-implemented in https://github.com/cmr/rust/tree/unsafe-transmutes)
nikomatsakis commentedon Mar 28, 2014
Ah, the proposed changes to transmute are in #12898, not the RFC.
steveklabnik commentedon Apr 20, 2015
Triage: nothing has changed, these transmutes still silently work:
lint: deny transmuting from immutable to mutable, since it's undefine…
lint: deny transmuting from immutable to mutable, since it's undefine…
lint: deny transmuting from immutable to mutable, since it's undefine…
lint: deny transmuting from immutable to mutable, since it's undefine…
lint: deny transmuting from immutable to mutable, since it's undefine…
lint: deny transmuting from immutable to mutable, since it's undefine…
Auto merge of #24392 - seanmonstar:lint-transmute-mut, r=alexcrichton
lint: deny transmuting from immutable to mutable, since it's undefine…
Auto merge of rust-lang#13146 - Alexendoo:cast-lossless-128, r=y21