Skip to content

Weird error when wrongly defining doc at end of struct #30322

Closed
@est31

Description

@est31

Consider this code:

struct FunStruct {
    /// fun having errors
}

It is obviously wrong, doc comments have to be before items. The error rustc gives one is very weird however:

<anon>:3:1: 3:2 error: expected ident
<anon>:3 }
         ^

Is rust python?

Note this only seems to happen for structs. functions and traits display smarter error messages.

cc @nikomatsakis bc I've heard on irc he wants to be notified on weird errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions