Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Manishearth opened this Issue Sep 21, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@Manishearth
Copy link
Member

Manishearth commented Sep 21, 2015

#[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

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented Sep 21, 2015

This affects Servo's ongoing rustup.

Manishearth added a commit to Manishearth/rust that referenced this issue Sep 21, 2015

Make function pointers implement traits for up to 12 parameters
(12 was chosen to be consistent with what we do for tuples)

Fixes rust-lang#28559

bors added a commit that referenced this issue Sep 21, 2015

Auto merge of #28560 - Manishearth:fix-fnptr-impls, r=nrc
(12 was chosen to be consistent with what we do for tuples)

Fixes #28559

@bors bors closed this in #28560 Sep 21, 2015

brson added a commit to brson/rust that referenced this issue Oct 16, 2015

Make function pointers implement traits for up to 12 parameters
(12 was chosen to be consistent with what we do for tuples)

Fixes rust-lang#28559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.