rust-lang / rust-lang/reference
Closure trait descriptions could be clearer.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
https://doc.rust-lang.org/reference/types/closure.html#other-traits
A closure is Send if all variables captured by non-unique immutable reference are Sync, and all values captured by unique immutable or mutable reference, copy, or move are Send.
This phrase suggests that there are three types of references:
- non-unique immutable
- unique immutable
- unique mutable
But typically only & and &mut are considered. What does "unique immutable reference" mean? Shall the phrase be made clearer and some code example of Send vs !Send closure peculiarities be demonstrated?
IRC provided the help:
<demize> _Vi: https://doc.rust-lang.org/reference/types/closure.html#unique-immutable-borrows-in-captures
Maybe at least the phrase "unique immutable" in "Other traits" should link there?
Contributor guide
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
Start at the Reference's closure "Other traits" section and follow the linked "Unique immutable borrows in captures" section. Clarify what "unique immutable reference" means, consider linking that term directly, and determine whether Send versus !Send closure examples are needed; done means the trait description is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100