1
Fork 0
rust/tests/ui/repeat-expr/no-conservative-copy-impl-requirement.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
338 B
Rust
Raw Normal View History

2025-02-15 02:01:41 +00:00
#![feature(generic_arg_infer)]
struct Foo<const N: usize>;
impl Clone for Foo<1> {
fn clone(&self) -> Self {
Foo
}
}
impl Copy for Foo<1> {}
fn unify<const N: usize>(_: &[Foo<N>; N]) {
loop {}
}
fn main() {
let x = &[Foo::<_>; _];
//~^ ERROR: type annotations needed for `&[Foo<_>; _]`
_ = unify(x);
}