Skip to content

Diagnostics for tuple structs should not mention ::{{constructor}} #41313

@whitequark

Description

@whitequark

To reproduce:

struct X(u32);

fn main() {
    match X(0) {
        X { data } => ()
    }
}

This results in:

error[E0026]: struct `X::{{constructor}}` does not have a field named `data`
 --> <anon>:5:13
  |
5 |         X { data } => ()
  |             ^^^^ struct `X::{{constructor}}` does not have field `data`

It seems rather pointless and potentially confusing to add the ::{{constructor}} part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions