Skip to content

derive(Copy) on tuple struct with non-Copy field uses unclear "<unnamed_field>" #27340

Closed
@huonw

Description

@huonw
struct Foo;
#[derive(Copy, Clone)]
struct Bar(Foo);

fn main() {}
<anon>:2:10: 2:14 error: the trait `Copy` may not be implemented for this type; field `<unnamed_field>` does not implement `Copy` [E0204]
<anon>:2 #[derive(Copy, Clone)]
                  ^~~~

It'd be nice to mention either the type, or the field index. (Or both.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions