Open
Description
When a comment ends with a trailing whitespace, cargo fmt --check
gives an unclear error message.
fn main() {
// Comment with trailing whitespace
println!("Hello world");
}
Error message:

output of rustfmt -V
on my machine: rustfmt 1.8.0-nightly (b48576b4db 2025-03-22)
I think there are Unicode characters that can be used to represent unwanted spaces, like U+2423, U+23B5 or U+25AF