Skip to content

Const generic arguments should be disambiguated from type arguments #60804

Closed
@varkor

Description

@varkor

At the moment, const arguments have to be wrapped in curly brackets, even if they are parameters.
E.g.

impl<const X: u32> Foo<{X}> { /* ... */ }

Due to:
https://github.com/rust-lang/rust/blob/036e368d6883e0bc141c1b54578876cd5bfb2468/src/libsyntax/parse/parser.rs#L5952-L5957

Edit: Direct repro: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=85fcc01c6258677c94c5a8cd3d144cbe

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)F-const_generics`#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions