//# publish module 0x42.VTest { struct T has drop {fint: u64, fv: bool} public new(x: u64, y: bool): Self.T { label b0: return T{fint: move(x), fv: move(y)}; } public t1(this: &Self.T): u64 { let x: &u64; label b0: x = ©(this).T::fint; _ = move(this); return *move(x); } public t2(this: &Self.T): u64 { let x: &u64; label b0: x = ©(this).T::fint; _ = move(this); return *move(x); } public t3(this: &Self.T): bool { let x: &bool; label b0: x = ©(this).T::fv; _ = move(this); return *move(x); } } //# publish module 0x42.RTest { struct T{fint: u64, fv: bool} public new(x: u64, y: bool): Self.T { label b0: return T{fint: move(x), fv: move(y)}; } public t1(this: &Self.T): u64 { let x: &u64; label b0: x = ©(this).T::fint; _ = move(this); return *move(x); } public t2(this: &Self.T): u64 { let x: &u64; label b0: x = ©(this).T::fint; _ = move(this); return *move(x); } public t3(this: &Self.T): bool { let x: &bool; label b0: x = ©(this).T::fv; _ = move(this); return *move(x); } public destroy_t(t: Self.T) { let fint: u64; let fv: bool; label b0: T{ fint, fv } = move(t); return; } } //# run import 0x42.RTest; import 0x42.VTest; main() { let vt: VTest.T; let vref: &VTest.T; let rt: RTest.T; let rref: &RTest.T; let r1: u64; let r2: u64; let r3: u64; let r4: u64; let r5: bool; let r6: bool; label b0: vt = VTest.new(0, false); vref = &vt; rt = RTest.new(0, false); rref = &rt; r1 = VTest.t1(copy(vref)); r2 = RTest.t1(copy(rref)); r3 = VTest.t2(copy(vref)); r4 = RTest.t2(copy(rref)); r5 = VTest.t3(move(vref)); r6 = RTest.t3(move(rref)); RTest.destroy_t(move(rt)); return; }