Skip to content

Rustfmt deletes comments in 'use {}' #4708

Closed
@darakshan

Description

@darakshan

Describe the bug

To Reproduce
run rustfmt on the following code:

use {std::env::args /* this comment gets removed */};
fn main() {println!("hello from {}!", args().next().unwrap());}

Expected behavior

comment should be preserved

Meta

  • rustfmt version: rustfmt 1.4.30-stable (8c6769d 2021-01-18)
  • From where did you install rustfmt? :rustup
  • How do you run rustfmt: Cargo-fmt and VScode

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