Skip to content

[Feature Request] Maintain newlines between crate-level attributes #5947

Open
@joshlf

Description

@joshlf

Given the following code:

//! Foobar
#![doc = "baz"]

// Allow some lints
#![allow(unknown_lints)]

...rustfmt removes the newline separating the crate-level doc comment from the next block:

//! Foobar
#![doc = "baz"]
// Allow some lints
#![allow(unknown_lints)]

IMO this is the wrong behavior; in my particular use case, I intended to logically separate the crate-level doc comment from other crate-level attributes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions