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 token
This compiles file:
but
rustfmtformats it into this:try this live (just click on
Formatin the playground)which fails to compile with: