Skip to content

format_code_in_doc_comments insert extra line with trailing whitespaces if there there's a comment and a hash #6016

Open
@stepancheg

Description

@stepancheg

Input:

//! Test test
//!
//! ```
//! # fn main() {
//! println!("hello"); // Comment
//! # }
//! ```

mod arena;
rustfmt +nightly --config format_code_in_doc_comments=true

outputs:

//! Test test
//!
//! ```
//! # fn main() {
//! println!("hello"); // Comment
//!<5 SPACES>
//! # }
//! ```

mod arena;
image
rustfmt 1.7.0-nightly (ca663b06 2024-01-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentse-trailing whitespaceerror[internal]: left behind trailing whitespaceonly-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions