Skip to content

Rustfmt should add enforce a single empty line before a doc comment #4781

Open
@Hofer-Julian

Description

@Hofer-Julian

Input

use std::cell::RefCell;
/// Main function
fn main() {
    let a = RefCell::new(2);
    dbg!(a);
}

Output

use std::cell::RefCell;
/// Main function
fn main() {
    let a = RefCell::new(2);
    dbg!(a);
}

Expected output

use std::cell::RefCell;

/// Main function
fn main() {
    let a = RefCell::new(2);
    dbg!(a);
}

Meta

  • rustfmt version: rustfmt 1.4.30-stable
  • From where did you install rustfmt?: rustup

CC @GuillaumeGomez

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