Skip to content

Bad parse error when omitting struct fields in constructor expression #8247

Closed
@emberian

Description

@emberian
struct Foo {
    f: uint
}

fn foo() -> Foo {
    Foo {
        123,
    }
}
foo.rs:6:8: 6:9 error: expected `;` or `}` after expression but found `{`
foo.rs:6     Foo {
                 ^

I would expect something much more... helpful. (Yes, I'm tired and the bug is obvious, but it's still a silly error message!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-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