If i make a struct with just f32 and [f32;4] like values in Rust, can i assume the struct to safely transmute to an [f32;sizeof thing] always?
-
-
Replying to @rikarends
You need to add #[repr(transparent)] for that guarantee.
1 reply 0 retweets 1 like -
Replying to @RReverser
Yeah im not using any other newtypes/wrapper types IN that struct. Its just bare f32 and [f32;4] [f32;16] values.
2 replies 0 retweets 0 likes -
Replying to @rikarends @RReverser
when i check things with size_of it seems to do the right thing. Repr(C) is actually weirder when you add say an f64 (which i don't)
1 reply 0 retweets 0 likes
Replying to @rikarends @RReverser
What @RReverser said. It's UB if you don't do that, even though it will "work," unicorns and rainbows and all that.
6:36 AM - 22 Nov 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.