Skip to content

Const generics are handled incorrectly #3554

Closed
@DutchGhost

Description

@DutchGhost

When I run cargo fmt over the following code:

#![feature(const_generics)]

pub struct S<const N: usize>;
impl S<{ 0 }> {}

the impl block is formatted to this:

impl S<{ 0 }> { 0 }> {}

which then obviously fails to compile.

playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=be54fe6369c6945d0a5e7a372ce49098

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.p-high

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions