Skip to content

Confusing Error Message When Doc Comment inside Array #27429

Closed
@Havvy

Description

@Havvy

Probably a few other places where it's also confusing.

Should probably state something like 'unexpected doc comment. A doc comment must precede an item`.

fn main() { let a = [1.0, 1.0 /** b */, 1.0]; }
<anon>:1:31: 1:39 error: expected one of `,`, `.`, or an operator, found `/** b */`
<anon>:1 fn main() { let a = [1.0, 1.0 /** b */, 1.0]; }
                                       ^~~~~~~~
playpen: application terminated with error code 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions