//! rejects: 19:13: cannot move a value out of a static outside unsafe code //! Safe code cannot move a value out of a static, because the static would //! still hold it and the value would have two owners. /// Record that moves when it is used by value. record Cell { /// Counter. count: u32, } /// Static record. static CELL: Cell = Cell { count: 0 }; /// Helper that takes ownership of a cell. fn consume(cell: Cell) {} /// Move the cell out twice. fn moveTwice() { consume(CELL); consume(CELL); } @default fn main() -> i32 { return 0; }