-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Copy not implemented for (u32, u32) error #88047
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This seems to be a fn foo<T: Copy, const N: usize>(a: [T; N]) -> [T; N] {
a
}
fn main() {
let SPAM: [(u32, u32); 1] = foo([(1, 1)]);
} |
I think this was caused by #87375 - cc @fee1-dead |
This works: #![feature(const_fn_trait_bound)]
#![feature(const_trait_bound_opt_out)]
const fn foo<T: ?const Copy, const N: usize>(a: [T; N]) -> [T; N] {
a
}
fn main() {
const SPAM: [(u32, u32); 1] = foo([(1, 1)]);
} |
As a side note - all |
What's the implication on const fn foo2<T: Clone>(x: &T) {}
const fn foo<T: Copy>(x: &T) {
foo2(x)
} This currently is forbidden (with a very non-intuitive error message of |
|
I remember some discussion around super traits in the RFC PR. It is undecided, for
with With that, I can't come up with a trivial fix for this issue. |
It seems this isn't a bug, and nbdd0121 has fixed my code, so should we close this issue down? |
Using the last Nightly (this error didn't happen with the Nightly of the precedent day):
Gives:
The text was updated successfully, but these errors were encountered: