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

Consider a struct with fields declared in this order, with one field also holding a guard. In what order do the destructors run when `s` goes out of scope, and what governs it?

struct S { a: Guard, b: Guard, c: Guard } let s = S { a: Guard(1), b: Guard(2), c: Guard(3) }; // drops at end of scope