`normalize_comments = true` causes malformed comments
Open
Nobody has claimed this yet.
A-comments
only-with-option
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
Input:
struct A {
x: usize,
/* protected int[] observed; */
/* (int, int)[] stack; */
}
Expected output:
struct A {
x: usize,
/* protected int[] observed;
* (int, int)[] stack; */
}
or
struct A {
x: usize,
// protected int[] observed;
// (int, int)[] stack;
}
Actual output:
struct A {
x: usize,
/* protected int[] observed; */
* (int, int)[] stack; */
}
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
Reproduce the example with rustfmt using normalize_comments = true, then trace the comment-normalization entry point responsible for adjacent block comments. The fix is done when the input produces one valid block comment or separate line comments without duplicated delimiters, with a regression test covering this case.
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
- Clearly specified
- Newbie friendliness
- 45/100