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 keeps reformatting C-style doc comment #4020

Closed
davepacheco opened this issue Jan 16, 2020 · 2 comments · Fixed by #4071
Closed

rustfmt keeps reformatting C-style doc comment #4020

davepacheco opened this issue Jan 16, 2020 · 2 comments · Fixed by #4071
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.

Comments

@davepacheco
Copy link

Using this version of rustfmt:

$ cargo +nightly fmt -- -V
rustfmt 1.4.11-nightly (18382352 2019-12-03)

and starting with this file:

/** foobar */
const foo: u32 = 0;

I find that rustfmt keeps adding asterisks to the end of the comment. If I keep re-running rustfmt, I get more asterisks:

$ cat src/dummy.rs 
/** foobar */
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar **/
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar * **/
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar * * **/
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar * * * **/
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar * * * * **/
const foo: u32 = 0;
$ cargo +nightly fmt -- src/dummy.rs 
$ cat src/dummy.rs 
/** foobar * * * * * **/
const foo: u32 = 0;
$ 
@topecongiro topecongiro added a-comments bug Panic, non-idempotency, invalid code, etc. labels Jan 17, 2020
@topecongiro
Copy link
Contributor

@davepacheco I was not able to reproduce this locally. Are you using any configuration option?

@davepacheco
Copy link
Author

Sorry for leaving that out! I see this with a rustfmt.toml that contains only wrap_comments = true. I do not see this with default options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants