Skip to content

A line-broken struct literal is indented one level too deep if followed by a method call #1139

Closed
@nabijaczleweli

Description

@nabijaczleweli

Happens on: v0.5, v0.6, master (59e199b)

Example code follows.

Expected:

struct Struct {
    i: i32,
    j: i32,
    k: i32,
    l: i32,
    m: i32,
}

impl Struct {
    fn err(self) -> ! {}
}

fn main() {
    Struct {
        i: 0,
        j: 0,
        k: 0,
        l: 0,
    }
    .err();
}

Actual:

struct Struct {
    i: i32,
    j: i32,
    k: i32,
    l: i32,
    m: i32,
}

impl Struct {
    fn err(self) -> ! {}
}

fn main() {
    Struct {
            i: 0,
            j: 0,
            k: 0,
            l: 0,
        }
        .err();
}

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