//# publish module 0x1.Token { import 0x1.signer; struct T has key { count: u64 } public test(account: &signer) acquires T { let t_ref: &mut Self.T; let count_ref: &mut u64; let local: u64; let local_ref: &mut u64; let sender: address; label b0: move_to(copy(account), T { count: 0 }); sender = signer.address_of(move(account)); t_ref = borrow_global_mut(move(sender)); count_ref = &mut move(t_ref).T::count; local = 0; local_ref = &mut local; // make sure refs are equal even if one is in global storage and one is local assert(move(count_ref) == move(local_ref), 42); return; } } //# run --signers 0x1 import 0x1.Token; main(account: signer) { label b0: Token.test(&account); return; }