rust-lang / rust-lang/reference

Document what `mut` does in identifier patterns

Open
#1,103 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-patterns
Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

The syntax is documented in the reference: https://doc.rust-lang.org/stable/reference/patterns.html#identifier-pattern, but afaict not the meaning.

Impact

Experienced users can still get tripped up by things like: https://stackoverflow.com/questions/69845063/why-does-a-level-of-indirection-allow-omitting-mut (I'm a Rust n00b, but posted the question for a Rust-experienced colleague).

How to fix:

If someone has a definition of mut handy, I can make PRs to update relevant parts of the docs. Apologies if mut is already defined and I missed it.

moved from https://github.com/rust-lang/rust/issues/90605

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust Reference's identifier-pattern section linked in the issue and compare its existing syntax description with the behavior of mut. Use the linked Stack Overflow example to identify the missing explanation, then update the relevant reference documentation so the meaning and indirection behavior are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.