Input (Playground):
pub trait Trait {
type I: Iterator<
// This is an item
Item = Self,
>
where
Self: Copy;
}
Expected: rustfmt produces the same code as input.
Output: rustfmt produces the following invalid code
pub trait Trait {
type I: Iterator<
// This is an item
Item = Self,
>
: Iterator<
// This is an item
Item = Self,
>
where
Self: Copy;
}
Version
$ rustfmt --version
rustfmt 1.8.0-stable (ded5c06cf2 2025-12-08)