Skip to content

Missing comma when defaulting fields on a struct #96871

Closed
@gilescope

Description

@gilescope

Context: You have an existing struct which has some fields defaulted. If you add another field but forget the comma like this:

struct A {
    field1: String,
    field2: String
    ..default()
}

Then currently rustc complains about a range. Here's a snapshot of an actual example:
image

It could be a legitimate range problem but in that situation it might very well be a missing comma.

Metadata

Metadata

Assignees

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