We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
stable
rustc --version: rustc 1.59.0 (9d1b2106e 2022-02-23) rustfmt --version: rustfmt 1.4.38-stable (9d1b210 2022-02-23)
rustc --version
rustc 1.59.0 (9d1b2106e 2022-02-23)
rustfmt --version
rustfmt 1.4.38-stable (9d1b210 2022-02-23)
nightly
rustc --version: rustc 1.61.0-nightly (8d60bf427 2022-03-19) rustfmt --version: rustfmt 1.4.38-nightly (8d60bf4 2022-03-19)
rustc 1.61.0-nightly (8d60bf427 2022-03-19)
rustfmt 1.4.38-nightly (8d60bf4 2022-03-19)
Current stable and nightly rustfmts format the following code incorrectly
rustfmt
struct Example<const N: usize = { 1048576 }> { // }
to
struct Example<const N: usize = { 1048576 }> { 1048576 }> { // }
Or, with normalize_comments = true set
normalize_comments = true
struct Example<const N: usize = { 1048576 }> { // 1048576 }> { }
In this case there is a new // 1048576 }> { prepended on every format operation
// 1048576 }> {
The text was updated successfully, but these errors were encountered:
Thanks for the report!
looks like the Span we're using is off. A similar issue was seen with #5011, so I imagine the fix should be similar to that.
Span
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
stable
rustc --version
:rustc 1.59.0 (9d1b2106e 2022-02-23)
rustfmt --version
:rustfmt 1.4.38-stable (9d1b210 2022-02-23)
nightly
rustc --version
:rustc 1.61.0-nightly (8d60bf427 2022-03-19)
rustfmt --version
:rustfmt 1.4.38-nightly (8d60bf4 2022-03-19)
Current stable and nightly
rustfmt
s format the following code incorrectlyto
Or, with
normalize_comments = true
setIn this case there is a new
// 1048576 }> {
prepended on every format operationThe text was updated successfully, but these errors were encountered: