Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustDrop plus move interactionSingle-choice MCQ

When a value is moved out of a local variable and that value's type needs drop glue, how does the compiler ensure the destructor runs exactly once and not on the moved-from slot?

let a = String::from("x"); let b = a; // move // scope ends