Skip to content

Formatting @generated from stdin results in empty output #5172

Closed
@bjorn3

Description

@bjorn3

This causes rust-analyzer to discard the entire file if you try to format it. See rust-lang/rust-analyzer#11285.

$ echo "//@notgenerated\nfn   foo() {}" | rustfmt
//@notgenerated
fn foo() {}
$ echo "//@generated\nfn   foo() {}" | rustfmt
$ rustfmt -V
rustfmt 1.4.38-stable (02072b4 2022-01-11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions