//# publish module 0x1.Tester { struct X { f: u64 } bump_and_give(x_ref: &mut Self.X): &u64 { label b0: *(&mut copy(x_ref).X::f) = *&mut copy(x_ref).X::f + 1; return &move(x_ref).X::f; } contrived_example(x_ref: &mut Self.X): &u64 { let returned_ref: &u64; label b0: returned_ref = Self.bump_and_give(copy(x_ref)); // it is valid to immutably extend the reference // even though a mut extension + freeze would be invalid assert(*copy(returned_ref) == *&move(x_ref).X::f, 42); return move(returned_ref); } }