struct S { v: i32, } impl Drop for S { fn drop(&mut self) { println!("This is an S structure with value {}: so long, and thanks for all the fish!", self.v) } } fn main() { let s1 = S{v: 1}; let s3 = S{v: 3}; let rs = &s3; println!("Start of main, {} is on the stack!", s1.v); println!("{} is also here...", s3.v); { let s2 = S{v: 2}; println!("Inner block: {} is on the stack!", s2.v); } println!("{} is still there...", rs.v); println!("{} is still there...", s1.v) }