//# publish module 0x1.M { struct X has drop { f: Self.Y } struct Y has drop { g: u64, h: u64 } t1() { let x: Self.X; let ref_x: &mut Self.X; let ref_x_f: &mut Self.Y; let ref_x_f_g: &mut u64; let ref_x_f_h: &mut u64; label b0: x = X { f: Y { g: 0, h: 0 } }; ref_x = &mut x; ref_x_f = &mut move(ref_x).X::f; ref_x_f_g = &mut copy(ref_x_f).Y::g; // Error: the argument for parameter b is borrowed Self.foo(move(ref_x_f_g), move(ref_x_f)); return; } foo(a: &mut u64, b: &mut Self.Y) { label b0: return; } } //# publish module 0x1.M2 { struct X has drop { f: Self.Y } struct Y has drop { g: u64, h: u64 } t2() { let x: Self.X; let ref_x: &mut Self.X; let ref_x_f: &mut Self.Y; let ref_x_f_g: &mut u64; let ref_x_f_h: &mut u64; label b0: x = X { f: Y { g: 0, h: 0 } }; ref_x = &mut x; ref_x_f = &mut move(ref_x).X::f; ref_x_f_g = &mut copy(ref_x_f).Y::g; // Error: the argument for parameter a is borrowed Self.bar(move(ref_x_f), move(ref_x_f_g)); return; } bar(a: &mut Self.Y, b: &mut u64) { label b0: return; } }