Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
limit and delimit available fields in note
Also, don't show the note if no fields are available (usually due to privacy).
- Loading branch information
1 parent
bf7e91f
commit 2dbfa39
Showing
11 changed files
with
46 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
error[E0560]: struct `submodule::Demo` has no field named `inocently_mispellable` | ||
--> $DIR/issue-42599_available_fields_note.rs:22:39 | ||
--> $DIR/issue-42599_available_fields_note.rs:26:39 | ||
| | ||
22 | Self { secret_integer: 2, inocently_mispellable: () } | ||
26 | Self { secret_integer: 2, inocently_mispellable: () } | ||
| ^^^^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `innocently_misspellable`? | ||
|
||
error[E0560]: struct `submodule::Demo` has no field named `egregiously_nonexistent_field` | ||
--> $DIR/issue-42599_available_fields_note.rs:26:39 | ||
--> $DIR/issue-42599_available_fields_note.rs:30:39 | ||
| | ||
26 | Self { secret_integer: 3, egregiously_nonexistent_field: () } | ||
30 | Self { secret_integer: 3, egregiously_nonexistent_field: () } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `submodule::Demo` does not have this field | ||
| | ||
= note: available fields are: favorite_integer, secret_integer, innocently_misspellable | ||
= note: available fields are: `favorite_integer`, `secret_integer`, `innocently_misspellable`, `another_field`, `yet_another_field` ... and 2 others | ||
|
||
error[E0609]: no field `inocently_mispellable` on type `submodule::Demo` | ||
--> $DIR/issue-42599_available_fields_note.rs:36:41 | ||
--> $DIR/issue-42599_available_fields_note.rs:40:41 | ||
| | ||
36 | let innocent_field_misaccess = demo.inocently_mispellable; | ||
40 | let innocent_field_misaccess = demo.inocently_mispellable; | ||
| ^^^^^^^^^^^^^^^^^^^^^ did you mean `innocently_misspellable`? | ||
|
||
error[E0609]: no field `egregiously_nonexistent_field` on type `submodule::Demo` | ||
--> $DIR/issue-42599_available_fields_note.rs:38:42 | ||
--> $DIR/issue-42599_available_fields_note.rs:42:42 | ||
| | ||
38 | let egregious_field_misaccess = demo.egregiously_nonexistent_field; | ||
42 | let egregious_field_misaccess = demo.egregiously_nonexistent_field; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown field | ||
| | ||
= note: available fields are: favorite_integer, innocently_misspellable | ||
= note: available fields are: `favorite_integer`, `innocently_misspellable` | ||
|
||
error: aborting due to 4 previous errors | ||
|