playground
struct Bomb(&'static str);
impl Drop for Bomb {
fn drop(&mut self) {
println!("{}", self.0);
}
}
fn main() {
let (a, b) = (Bomb("a"), Bomb("b"));
let (c, d) = (Bomb("c"), Bomb("d"));
}
d
c
b
a
I was indeed talking about let bindings and not members of a type. (My bad for not specifying more clearly.)
Drop order (the observable part of drop glue) is documented in the linked RFC; I’m curious about the mechanism used by the drop glue. (i.e. how much Drop::drop is in charge of and how much is handled inline by the drop glue.) That’s what would have to change by a Drop-changing proposal, and what I’m interested in actually specifying in terms of.