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

Given the code, in what order are the destructors run?

struct Loud(&'static str); impl Drop for Loud { fn drop(&mut self) { println!("{}", self.0); } } fn main() { let _a = Loud("a"); let _b = Loud("b"); let _c = Loud("c"); let _ = Loud("temp"); }