rust-lang / rust-lang/rust

consider removing `allow(unused_mut)` from core and std doctests

Open
#139,604 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

A lot of new rust users get confused about the relationship between mut bindings and &mut, and the doctests don't really help with this, with core alone having 21 doctests emitting this lint. most of these are mut bindings that hold a mutable reference.

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

Search the core and std doctests for allow(unused_mut), then inspect the affected examples and their lint output. Done means unnecessary allowances are removed, the doctests still compile, and the examples better clarify the distinction between mut bindings and &mut references.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.