-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
On current beta, at least, I see:
error: attempted access of field `test_results` on type `TestResult`, but no field with that name was
found
--> src/main.rs:196:25
|
196 | tests_passed += normal_test.test_results.iter().filter(|t| t.status == "ok").count();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: did you mean `results`?
--> src/main.rs:196:37
|
196 | tests_passed += normal_test.test_results.iter().filter(|t| t.status == "ok").count();
| ^^^^^^^^^^^^
But I feel like I'd rather see:
error: attempted access of field `test_results` on type `TestResult`, but no field with that name was
found
--> src/main.rs:196:25
|
196 | tests_passed += normal_test.test_results.iter().filter(|t| t.status == "ok").count();
| ^^^^^^^^^^^^
= help: did you mean `results`?
Come to think of it, we could shorten the main message and move the suggestion into the label, as I think you've done elsewhere:
error: no field `test_results` on type `TestResult`
--> src/main.rs:196:25
|
196 | tests_passed += normal_test.test_results.iter().filter(|t| t.status == "ok").count();
| ^^^^^^^^^^^^ did you mean `results`?
|
Standalone example:
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.