Here's another "error[internal]: left behind trailing whitespace" bug: gist. rustfmt 1.2.2-stable (5274b49 2019-04-24), 1.4.1-nightly (9e960e7 2019-07-30).
error[internal]: left behind trailing whitespace
--> /usr/local/src/sokoban-rs/rs/rustfmtbug.rs:184:184:15
|
184 | let layer =
| ^
|
error[internal]: left behind trailing whitespace
--> /usr/local/src/sokoban-rs/rs/rustfmtbug.rs:201:201:15
|
201 | let layer =
| ^
|
warning: rustfmt has failed to format. See previous 2 errors.
I tried to cut the example down to something reasonable, but the bug seems really fragile. Apologies.
minimal reproducible example:
fn main() {
{
#[rustfmt::skip]
let _ =
[1];
}
}
playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=673db728a775e9e6943975b63e9158f9
The code under rustfmt::skip should not trigger left behind trailing whitespace errors.
I get this for let toml in here using a r#" in the next line.
@0xpr03 your bug seems to be another reason, so I created new issue #3786.