`move` `Copy` values
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
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.movelet a = 42 in { ... };
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
This is a language-design proposal for changing how moved Copy values behave, with move(expr) and several alternatives listed. Start by reviewing Rust's existing move and Copy semantics and the RFC process; done would require an agreed design and accepted RFC rather than a localized code change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100