Rustfmt: Another "error[internal]: left behind trailing whitespace" bug

Created on 31 Jul 2019  路  4Comments  路  Source: rust-lang/rustfmt

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cramertj picture cramertj  路  4Comments

LPGhatguy picture LPGhatguy  路  3Comments

tkilbourn picture tkilbourn  路  5Comments

Jerald picture Jerald  路  4Comments

ozkriff picture ozkriff  路  4Comments