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
For some programs with a doc-comment at an unexpected / invalid location, rustfmt moves the following line of significant code into the comment, effectively removing it and changing the meaning of the program.
To Reproduce
example.rs:
fnfoo(/// docarg:u32,){}
rustfmt example.rs --emit stdout
Expected behavior
Even though this program does not compile because doc-comments are invalid at that location, the source should be printed unchanged.
Actual behavior
In the formatted code, the argument has effectively been commented out
I can take this one. Test cases added for issue #4245 does not include doc-style and block-style, and indeed rustfmt make the following function signature one-line:
Describe the bug
For some programs with a doc-comment at an unexpected / invalid location, rustfmt moves the following line of significant code into the comment, effectively removing it and changing the meaning of the program.
To Reproduce
example.rs
:rustfmt example.rs --emit stdout
Expected behavior
Even though this program does not compile because doc-comments are invalid at that location, the source should be printed unchanged.
Actual behavior
In the formatted code, the argument has effectively been commented out
Meta
rustfmt
command line for minimized steps, VSCode + rust-analyzer extension + "format on save" otherwiseThe text was updated successfully, but these errors were encountered: