Skip to content

destructive formatting when dealing with const generics #4310

Description

@lcnr

When formatting

#![feature(const_generics)]

fn foo<
    const N: [u8; {
        struct Inner<'a>(&'a ());
        3
    }],
>() {}

rustfmt changes the empty function argument list from () to (&'a (), which is incorrect.

#![feature(const_generics)]

fn foo<
    const N: [u8; {
        struct Inner<'a>(&'a ());
        3
    }],
>(&'a () {
}

Note that the original code snippet current does not yet compile due to the unfinished nature of const generics,
it should compile in the future though.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1x-backport:completedC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions