Skip to content

Indentation failure with many generic arguments #5657

Open
@mkeeter

Description

@mkeeter

When a set of generic arguments hits max-width, rustfmt seems to have trouble with indentation.

Here's an example:

fn omg() {
fn bar() {
self.core
.exchange::<LeaseBufReader<_, BUFSIZ>, _, LeaseBufWriter<_, BUFSIZ>, _>(
device_index,
src,
dest,
)
.map_err(RequestError::from)
}
}
$ rustfmt --config max_width=80 test.rs
fn omg() {
    fn bar() {
        self.core
.exchange::<LeaseBufReader<_, BUFSIZ>, _, LeaseBufWriter<_, BUFSIZ>, _>(
device_index,
src,
dest,
)
.map_err(RequestError::from)
    }
}

It properly indents the functions, but then gives up on the call to .exchange<...>.

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