struct S { v1: i32, v2: i32, } fn b(v: &S) -> &S { println!("Here we go: {} {}", v.v1, v.v2); v } fn a(v: &S) -> &S { let private_v = S{v1: 1, v2: 3}; println!("I got {} {} and I have {} {} local", v.v1, v.v2, private_v.v1, private_v.v2); b(&private_v) } fn main() { let my_v = S{v1: 2, v2: 4}; let v1 = a(&my_v); println!("{} {} {} {}", my_v.v1, my_v.v2, v1.v1, v1.v2) }