-
Notifications
You must be signed in to change notification settings - Fork 996
Open
Labels
A-associated-type-boundsArea: associated type boundsArea: associated type boundsA-commentsArea: commentsArea: commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEI-unexpectedly-removes-codeIssue: unexpectedly removes code that we should not be removingIssue: unexpectedly removes code that we should not be removing
Description
Summary
Forked out of #6234.
I tried to format this code:
trait Foo {
type Bar: Baz1 // what
;
}Expected behavior
I expected to see this happen:
- Comment is preserved
Actual behavior
Instead, this happened:
- Comment is removed
trait Foo {
type Bar: Baz1;
}Configuration
rustfmt cli options used (if applicable):
$ rustfmt repro.rs --checkrustfmt configuration file (e.g. rustfmt.toml, if applicable): N/A
Reproduction Steps
Trivial.
Meta
rustfmt --version:
rustfmt 1.8.0-stable (01f6ddf758 2026-02-11)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-associated-type-boundsArea: associated type boundsArea: associated type boundsA-commentsArea: commentsArea: commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEI-unexpectedly-removes-codeIssue: unexpectedly removes code that we should not be removingIssue: unexpectedly removes code that we should not be removing