rust-lang / rust-lang/rust

`./x fmt --all` is not idempotent

Open
#126,394 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug T-rustfmt
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In the use formatting PR #125443 it was noticed that ./x fmt --all was not idempotent, i.e. ./x fmt --all had to be run twice to reproduce the formatted diff.

(I tried looking for an existing issue for this but couldn't find one.)

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

Reproduce the report by running ./x fmt --all twice and comparing the resulting diff. Read the formatting changes discussed in PR #125443, especially the use formatting context, and identify why the first run changes output that the second run changes again; done means the command produces no further diff when repeated.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.