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
There is no guarantee that Vec<T> and Vec<U> have the same layout under the new rules. This needs to manually copy over the fields one by one which would compile to the same code as long as a feature like struct randomization wasn't enabled. Since vectors expose from_raw_parts, it could be switched to make use of that. However, this is a pervasive issue with transmute in the standard libraries.
The text was updated successfully, but these errors were encountered:
@thestinger I would like to fix this one. However, I don't understand why you would need to use from_raw_parts. If we need to copy everything, why don't we do it directly to a Vec?
There are 3 cases of this undefined behaviour in
std::ascii
:There is no guarantee that
Vec<T>
andVec<U>
have the same layout under the new rules. This needs to manually copy over the fields one by one which would compile to the same code as long as a feature like struct randomization wasn't enabled. Since vectors exposefrom_raw_parts
, it could be switched to make use of that. However, this is a pervasive issue withtransmute
in the standard libraries.The text was updated successfully, but these errors were encountered: