-
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 lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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.
Description
With RFC 1506 merged and stabilized, handling E0613
separate from E0609
is not the correct behaviour any more.
For context, you get E0613
when doing something like let _ = "hi".0;
:
error[E0613]: attempted to access tuple index `0` on type `&'static str`, but the type was not a tuple or tuple struct
And you get E0609
when doing something like let _ = "hi".foo;
:
error[E0609]: no field `foo` on type `&'static str`
RFC 1506 "clarified ADT kinds" (Rendered, tracking issue) allowed all structs to contain fields with integral names like 0
or 1
, etc. This makes the error message for E0613
outdated, as the type may be a non tuple struct, and calling 0
a "tuple index" sounds wrong as well.
So I propose E0613
to be merged into E0609
, as E0609
is now better suiting, and also because its "in the spirit" of the RFC.
The proposed new output for let _ = "hi".0;
is:
error[E0609]: no field `0` on type `&'static str`
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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.