Block doc comment without continuing asterisk (`*`) doesn't align asterisk in starter/closer
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
Summary
I tried to format this code:
Expected behavior
I expected to see this happen:
I'm unsure about ideal formatting, but maybe the asterisk (*) of the block doc comment starter/closer should align? Maybe
/**
foo
*/
mod foo;
Rationale is that in fixing a related non-idempotent closer rewrite (https://github.com/rust-lang/rustfmt/pull/7017), the fix changes block doc formatting to align the starter/closer by asterisk when there is a continuing (*):
/**
* foo
*/
mod foo;
This matches block doc comment formatting I've seen in other languages (e.g. javadoc). See discussion.
Actual behavior
Instead, this happened: no formatting changes; this is the stable formatting.
Configuration
rustfmt cli options used (if applicable): none needed
rustfmt configuration file (e.g. rustfmt.toml, if applicable): N/A
Reproduction Steps
Just plain rustfmt will do.
Meta
rustfmt --version:
rustfmt 1.9.0-stable (48a229ceae 2026-09-01)
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 with tests/target/6639-non-idempotent-block-doc-comments/outer-block-doc-comment.rs and run plain rustfmt to reproduce the current stable output. Review the related rustfmt PR 7017 discussion for context, then confirm the intended starter/closer alignment for a block doc comment without continuing asterisks; done means the behavior is formatted consistently and remains stable on repeated runs.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100