Open
Description
Copy
values have special copy semantics, when they're moved away, the old place still have valid value alive. A lot of times this is not people want. For example, it's very easy to typo and wrongly use some temporary values after they have been sent away with assignment.
If possible, i'd propose a move
expression:
`move` `(` expr `)`
The parenthesis are for avoiding the ambiguity with move closures.
Example:
let a = 42;
x.a = move(a);
double(&mut x.a);
dbg!(a); // compile error
Alternatives:
unlet a;
a.move
let a = 42 in { ... };
Metadata
Metadata
Assignees
Labels
No labels