You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I never had that before, but rustfmt fails for me with an error error[internal]: left behind trailing whitespace for this (I tried to break it down to the minimal example code below):
error[internal]: left behind trailing whitespace --> \\?\C:\Users\dailyuse\Desktop\repro-rustfmt\repro\src\lib.rs:16:16:1 |16 | | ^^^^^^^^ |warning: rustfmt has failed to format. See previous 1 errors.
In the match arm "bla", between the brackets are some whitespaces. If you remove the log::warn!() it works again, so it's definitely related. I wonder though, if this could be considered a bug in rustfmt?
The issue here is the "bli" match arm. You're running into #3863, and as a result rustfmt doesn't remove the whitespace that exists in your source code in the "bla" match arm.
There are a few ways you can work around this:
bump the max width so that the long log::warn! call can be formatted within the max with.
set format_strings=true so that rustfmt can try to break the long string literal to keep things within the max_width
refactor your code to keep things within the max_width
I never had that before, but
rustfmt
fails for me with an errorerror[internal]: left behind trailing whitespace
for this (I tried to break it down to the minimal example code below):A repository with the code can be found here: https://github.com/simonsan/rustfmt_repro
In the match arm "bla", between the brackets are some whitespaces. If you remove the
log::warn!()
it works again, so it's definitely related. I wonder though, if this could be considered a bug in rustfmt?Related: #6054 (?)
The text was updated successfully, but these errors were encountered: