struct S { v1: i32, v2: i32, } fn b<'a, 'b>(v1: &'a S, v2: &'b S) -> &'a S { println!("Here we go: {} {} {} {}", v1.v1, v1.v2, v2.v1, v2.v2); v1 } 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(&v, &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) }