Skip to content

E0613 needs to be merged into E0609 now #42945

Closed
@est31

Description

@est31

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

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions