-
Notifications
You must be signed in to change notification settings - Fork 970
Labels
A-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-poor-formattingIssue: poor formattingIssue: poor formatting
Description
This compiles file:
pub trait A {}
pub trait B {}
pub trait C {}
pub trait Foo:
// A and C
A + C
// and B
+ B
{}but rustfmt formats it into this:
pub trait Foo: A + C + B // A and C
A
+ C
// and B
+ B {
}try this live (just click on Format in the playground)
which fails to compile with:
Compiling playground v0.0.1 (file:///playground)
error: expected one of `(`, `+`, `::`, `<`, `where`, or `{`, found `A`
--> src/main.rs:6:1
|
5 | trait Foo: A + C + B // A and C:
| - expected one of `(`, `+`, `::`, `<`, `where`, or `{` here
6 | A + C
| ^ unexpected tokenMetadata
Metadata
Assignees
Labels
A-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-poor-formattingIssue: poor formattingIssue: poor formatting