Skip to content

Add help suggestion for semicolon used inside struct declaration #101440

Closed
@Rageking8

Description

@Rageking8

Given the following code: link

struct Num {
    a: i32;
}

fn main() {
 
}

The current output is:

   Compiling playground v0.0.1 (/playground)
error: expected `,`, or `}`, found `;`
 --> src/main.rs:2:11
  |
2 |     a: i32;
  |           ^

error: could not compile `playground` due to previous error

Ideally the output should suggest replacing the ; with , since a suggestion already exist for an incorrect semicolon usage at the end of the struct declaration (after the closing brace).

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions