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)); }
-
-
Nope. Or at least, we have tests to check it and it is intentional.
-
I could have sworn the drop order of struct fields is unspecified
- 3 more replies
New conversation -
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.