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

`D` implements `Drop`. The two `D` values are moved into `take` by value. In what order do their destructors run, and where?

struct D(&'static str); impl Drop for D { fn drop(&mut self) { println!("drop {}", self.0); } } fn take(_a: D, _b: D) { println!("in fn"); } fn main() { take(D("a"), D("b")); println!("after"); }