Open
Description
I ran cargo fmt
and it reported error[internal]: left behind trailing whitespace
and failed to format a file. Minimal reproduction:
impl Foo {
#[rustfmt::skip]
fn foo() {
Bar
// ^ there is whitespace here
}
}
error[internal]: left behind trailing whitespace
--> /playground/src/main.rs:4:4:11
|
4 | Bar
| ^^^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
The original case was a const
array of enum variants, so this is not specific to fn
s.
If the #[rustfmt::skip]
attribute is relocated to the entire impl block then the code is (correctly) skipped silently.
Meta
This seems very similar to #2037, but that specific case has not regressed.