rust-lang / rust-lang/rustfmt

Feature: Sort items/methods

Open
#4,372 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request P-low
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

I'd like if rustfmt could sort all of the items within a module, and also if it could sort all of the methods within an impl block and/or functions in an extern block.

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

No files, tests, or entry points are named. Start by locating rustfmt's handling of module items, impl methods, and extern-block functions, then establish the intended sorting rules and configuration behavior. Done means all requested blocks are sorted consistently and existing formatting behavior remains covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.