Skip to content

format_doc_comments causes adjacent comments to be made multiline #3268

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

Closed
DianaNites opened this issue Dec 24, 2018 · 2 comments
Closed

format_doc_comments causes adjacent comments to be made multiline #3268

DianaNites opened this issue Dec 24, 2018 · 2 comments
Labels
a-comments bug Panic, non-idempotency, invalid code, etc. only-with-option requires a non-default option value to reproduce

Comments

@DianaNites
Copy link

DianaNites commented Dec 24, 2018

I have format_doc_comments = true in my .rustfmt.toml, and all of a sudden my adjacent comments are being formatted in C Style multiline instead of left alone. Not doc comments.

For example, this

// pub nice: String,
// pub nice_adjacent: String,

will be turned into this

/* pub nice: String,
* pub nice_adjacent: String, */

These are also unaffected by the normalize_comments option


Version details:

rustfmt 1.0.1-nightly (be13559 2018-12-10), via rustup component.
cargo 1.33.0-nightly (2cf1f5dda 2018-12-11)
rustc 1.33.0-nightly (2d3e909 2018-12-22)

@topecongiro topecongiro added bug Panic, non-idempotency, invalid code, etc. a-comments only-with-option requires a non-default option value to reproduce labels Dec 25, 2018
@scampi
Copy link
Contributor

scampi commented Jan 31, 2019

If these comments are after a field inside a struct, that is on purpose. See #3209 and #93 for more details.

@DianaNites
Copy link
Author

Well, thats disappointing.

@scampi scampi closed this as completed Jan 31, 2019
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. only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants