Skip to content

Parse multiple consts from a single keyword #3777

Closed
@bstrie

Description

@bstrie

This feels like it should work:

const bar: int = 1,  // This should mirror the `let` syntax
      foo: int = 4;

fn main() {
    let baz: int = 0,
        qux: int = 1;
}

But instead you get:

const.rs:1:18: 1:19 error: expected `;` but found `,`
const.rs:1 const bar: int = 1,
                             ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions