Skip to content

Regression: Functions with 6+ arguments no longer Clone #28559

Closed
@Manishearth

Description

@Manishearth
#[derive(Copy, Clone)]
struct Foo {
 foo: fn(u8, u8, u8, u8, u8, u8),
}

Gives an error on nightly/beta, but not on stable

<anon>:4:2: 4:33 error: the trait `core::clone::Clone` is not implemented for the type `fn(u8, u8, u8, u8, u8, u8)` [E0277]
<anon>:4  foo: fn(u8, u8, u8, u8, u8, u8),
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:2:16: 2:21 note: in this expansion of #[derive_Clone] (defined in <anon>)
<anon>:4:2: 4:33 help: see the detailed explanation for E0277
<anon>:4:2: 4:33 note: required by `core::clone::Clone::clone`
error: aborting due to previous error
playpen: application terminated with error code 101

Reducing the number of arguments makes this compile.

cc @rust-lang/compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions