5

Don't mention already-set fields in struct constructor missing field error by co...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/112323
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Collaborator

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Jun 5, 2023

@@ -3,6 +3,8 @@ error[E0559]: variant `Option<_>::None` has no field named `value`

|

LL | None { value: (), ..Default::default() }.await;

| ^^^^^ `Option<_>::None` does not have this field

|

= note: all struct fields are already assigned

perhaps this could be a span-suggestion to remove the field altogether, but honestly I'm fine with just letting the programmer decide what to do with this

I think making a suggestion would be better, but it's fine as-is

@@ -3,6 +3,8 @@ error[E0559]: variant `Option<_>::None` has no field named `value`

|

LL | None { value: (), ..Default::default() }.await;

| ^^^^^ `Option<_>::None` does not have this field

|

= note: all struct fields are already assigned

I think making a suggestion would be better, but it's fine as-is

Member

@bors r+ rollup

Contributor

pushpin Commit 140c011 has been approved by WaffleLapkin

It is now in the queue for this repository.

bors

added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Jun 8, 2023

bors

merged commit 17cc282 into

rust-lang:master

Jun 9, 2023

11 checks passed

rustbot

added this to the 1.72.0 milestone

Jun 9, 2023

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Jun 9, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

WaffleLapkin

WaffleLapkin approved these changes
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

1.72.0

Development

Successfully merging this pull request may close these issues.

Skip filled in fields when suggesting field names

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK