Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustdrop order and drop glueSingle-choice MCQ

In `let (a, b) = (D("a"), D("b"));` where `D` is `Drop`, what governs the drop order of `a` and `b`, and what about a temporary tuple that is never bound?

struct D(&'static str); impl Drop for D { fn drop(&mut self){ println!("{}", self.0);} } fn main() { let (a, b) = (D("a"), D("b")); let _ = (D("x"), D("y")); // bound to wildcard }