Closed
Description
const fn foo<T: Copy, const N: usize>(a: [T; N]) -> [T; N] {
a
}
fn main() {
const SPAM: [(u32, u32); 1] = foo([(1, 1)]);
}
Using the last Nightly (this error didn't happen with the Nightly of the precedent day):
rustc 1.56.0-nightly (8007b506a 2021-08-14)
binary: rustc
commit-hash: 8007b506ac5da629f223b755f5a5391edd5f6d01
commit-date: 2021-08-14
host: x86_64-pc-windows-gnu
release: 1.56.0-nightly
LLVM version: 12.0.1
Gives:
error[E0277]: the trait bound `(u32, u32): Copy` is not satisfied
--> C:\lavoro\bugs\test.rs:5:39
|
1 | const fn foo<T: Copy, const N: usize>(a: [T; N]) -> [T; N] {
| ---- required by this bound in `foo`
...
5 | const SPAM: [(u32, u32); 1] = foo([(1, 1)]);
| ^^^^^^^^ the trait `Copy` is not implemented for `(u32, u32)`
|
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
4 | fn main() where (u32, u32): Copy {
| ++++++++++++++++++++++