What does this output? struct Print(u32); impl Drop for Print { fn drop(&mut self) { println!("{}", self.0); } } fn main() { let t = (Print(31), Print(32)); let (ref x, ref y) = (Print(21), Print(22)); let (x, y) = (Print(11), Print(12)); }
-
-
-
-
Replying to @sgrif
Nope. Or at least, we have tests to check it and it is intentional.
1 reply 0 retweets 1 like -
Replying to @Gankra_
I could have sworn the drop order of struct fields is unspecified
2 replies 0 retweets 0 likes -
-
Replying to @sgrif
Doesn’t ultimately have anything to do with drop order.
1 reply 0 retweets 0 likes
Replying to @Gankra_
Oh duh now that I see the output it makes more sense
8:51 AM - 13 Dec 2017
from Albuquerque, NM
0 replies
0 retweets
0 likes
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.