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)); }
-
-
Esp since field re-ordering is a thing
-
Doesn’t ultimately have anything to do with drop order.
- 1 more reply
New conversation -
-
-
It wasn’t designed but we spec’d it to be what we happened to be doing because we didn’t feel we could change it
-
There was an RFC that stabilized it: https://github.com/rust-lang/rfcs/blob/master/text/1857-stabilize-drop-order.md …
End of conversation
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.