Skip to content
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

Rustfmt deletes leading non-breaking space from comments #5638

Open
dtolnay opened this issue Dec 23, 2022 · 0 comments · May be fixed by #5643
Open

Rustfmt deletes leading non-breaking space from comments #5638

dtolnay opened this issue Dec 23, 2022 · 0 comments · May be fixed by #5643

Comments

@dtolnay
Copy link
Member

dtolnay commented Dec 23, 2022

This came up in rust-lang/rust#106098 (comment).

The 2 possible behaviors that seem reasonable to me are either:

  • keep the non-breaking space characters as is; or
  • replace non-breaking space (U+00A0) with ordinary space (U+0020) inside of comments.

The current behavior is not a way that I would expect rustfmt to behave.

Repro:

$ echo -e '/*\n  normal spaces\n\u00a0\u00a0non-breaking\u00a0spaces\n*/' | rustfmt
/*
  normal spaces
non-breaking spaces
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants