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

format_code_in_doc_comments adds trailing whitespace on the leading empty line #6015

Open
stepancheg opened this issue Jan 10, 2024 · 1 comment
Labels
a-comments e-trailing whitespace error[internal]: left behind trailing whitespace only-with-option requires a non-default option value to reproduce

Comments

@stepancheg
Copy link
Contributor

Input (no trailing whitespaces anywhere):

/// Hi
///
/// ```text
///
/// rrr
///
/// xxx
/// ```
fn foo() {
}
rustfmt +nightly --config format_code_in_doc_comments=true

outputs:

/// Hi
///
/// ```text
///<WHITESPACE>
/// rrr
///
/// xxx
/// ```
fn foo() {}
image

Note whitespace is inserted only on the first empty line.

rustfmt 1.7.0-nightly (ca663b06 2024-01-08)
@ytmimi ytmimi added a-comments only-with-option requires a non-default option value to reproduce e-trailing whitespace error[internal]: left behind trailing whitespace labels Jan 10, 2024
@ytmimi
Copy link
Contributor

ytmimi commented Jan 10, 2024

Thanks for the report. Linking the tracking issue for format_code_in_doc_comments (#3348)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments e-trailing whitespace error[internal]: left behind trailing whitespace only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants