-
Notifications
You must be signed in to change notification settings - Fork 889
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 breaks a /* ... */
comment into /* ... //
, with no terminating */
#6339
Comments
Confirming I can reproduce this using rustfmt 1.8.0-nightly (6157568 2024-09-20), Input use rustc_middle::ty::{self, Region, Ty, TyCtxt}; /* xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
* xxxxxxxxxxxxx */ Output use rustc_middle::ty::{self, Region, Ty, TyCtxt}; /* xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// xxxxxxxxxxxxx Footnotes
|
Thanks @ytmimi! |
Is it ok for me to work on this issue? @ytmimi I think the bug occurred because we try to Lines 285 to 289 in 5f48fe9
I suppose a correct fix would be not separating comment lines in case of multi line Input use Foo; /* x x x x x x
* x x
* */ Output use Foo; /* x x x x
* x x x x
* */ |
@dqkqd if you're interested in taking a look at this that would be great! |
With
version = "Two"
andwrap_comments = true
, rustfmt can break a/* ... */
comment by changing one of its lines to start with//
. The error does not occur without version "Two" or withoutwrap_comments
. Maybe worth noting, we have both of those options on at work.(Sorry if this is a duplicate bug, couldn't find anything by searching for
is:issue state:open "wrap_comments = true" "version = \"Two\""
)Reproduction steps:
On my computer, I get:
Which is not valid syntax.
rustfmt version:
The text was updated successfully, but these errors were encountered: