Skip to content

Unclear message for comments with trailing spaces #6545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
giluis opened this issue Apr 19, 2025 · 0 comments
Open

Unclear message for comments with trailing spaces #6545

giluis opened this issue Apr 19, 2025 · 0 comments

Comments

@giluis
Copy link

giluis commented Apr 19, 2025

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:

Image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant