Skip to content

Confusing parser error #2191

Closed
Closed
@brson

Description

@brson
enum Command = {
    name: option(Ident),
    op: Op
};
./dbl.rs:15:16: 15:17 error: expecting ',' but found '('
./dbl.rs:15     name: option(Ident),
                            ^

The errors says it was looking for a comma where the open paren is. I stared at at this for a long time wondering why it thought there should be a comma there. Eventually I realized that, even though it 'expected' a comma, there were other possible characters that it would have been happy with as well - in this case <.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions