//# publish module 0x1.A { import 0x1.signer; struct T1 has key {v: u64} struct T2 has key {v: u64} get_v(x: &mut Self.T1): &mut u64 { label b0: return &mut move(x).T1::v; } acquires_t1(account: &signer) acquires T1 { let v: u64; label b0: T1 { v } = move_from(signer.address_of(move(account))); return; } acquires_t2(account: &signer) acquires T2 { let v: u64; label b0: T2 { v } = move_from(signer.address_of(move(account))); return; } public test1(account: &signer) acquires T1, T2 { let x: &mut Self.T1; let y: &mut u64; label b0: x = borrow_global_mut(signer.address_of(copy(account))); y = Self.get_v(move(x)); Self.acquires_t1(copy(account)); // error T1 still acquired Self.acquires_t2(move(account)); _ = move(y); return; } } //# publish module 0x1.A2 { import 0x1.signer; struct T1 has key {v: u64} struct T2 has key {v: u64} get_v(x: &mut Self.T1): &mut u64 { label b0: return &mut move(x).T1::v; } acquires_t1(account: &signer) acquires T1 { let v: u64; label b0: T1 { v } = move_from(signer.address_of(move(account))); return; } acquires_t2(account: &signer) acquires T2 { let v: u64; label b0: T2 { v } = move_from(signer.address_of(move(account))); return; } public test2(account: &signer) acquires T1, T2 { let x: &mut Self.T1; let y: &mut u64; label b0: x = borrow_global_mut(signer.address_of(copy(account))); y = Self.get_v(move(x)); Self.acquires_t2(copy(account)); Self.acquires_t1(move(account)); // error T1 still acquired _ = move(y); return; } } //# publish module 0x1.A3 { import 0x1.signer; struct T1 has key {v: u64} struct T2 has key {v: u64} get_v(x: &mut Self.T1): &mut u64 { label b0: return &mut move(x).T1::v; } acquires_t1(account: &signer) acquires T1 { let v: u64; label b0: T1 { v } = move_from(signer.address_of(move(account))); return; } acquires_t2(account: &signer) acquires T2 { let v: u64; label b0: T2 { v } = move_from(signer.address_of(move(account))); return; } public test3(account: &signer) acquires T1, T2 { let x: &mut Self.T1; let y: &mut u64; label b0: x = borrow_global_mut(signer.address_of(copy(account))); y = Self.get_v(move(x)); Self.acquires_t1(copy(account)); // error T1 still acquired _ = move(y); Self.acquires_t2(move(account)); return; } }