Skip to content

#[cfg(debug_assertions)] on expression causing odd formatting #5873

Closed as not planned
@Centri3

Description

@Centri3

This code:

#[feature(stmt_expr_attributes)]

fn a() {
    let aaaaa = 1;
    let bbbb = 2;

    #[cfg(debug_assertions)]
    aaaaa * bbbb;
}

Is formatted into this:

#[feature(stmt_expr_attributes)]

fn a() {
    let aaaaa = 1;
    let bbbb = 2;

    #[cfg(debug_assertions)]
    aaaaa
        * bbbb;
}

Any line shorter than that (17 characters) is formatted correctly. Not entirely sure what's happening here.
Maybe related: #5871, but not sure.

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