2025-02-15 02:01:41 +00:00
|
|
|
//@revisions: current gai
|
|
|
|
|
//@[current] check-pass
|
|
|
|
|
|
|
|
|
|
#![cfg_attr(gai, feature(generic_arg_infer))]
|
2025-02-14 21:45:39 +00:00
|
|
|
|
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
|
|
struct Foo<T>(PhantomData<T>);
|
|
|
|
|
|
|
|
|
|
impl Clone for Foo<u8> {
|
|
|
|
|
fn clone(&self) -> Self {
|
|
|
|
|
Foo(PhantomData)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
impl Copy for Foo<u8> {}
|
|
|
|
|
|
|
|
|
|
fn extract<T, const N: usize>(_: [Foo<T>; N]) -> T {
|
|
|
|
|
loop {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let x = [Foo(PhantomData); 2];
|
2025-02-15 02:01:41 +00:00
|
|
|
//[gai]~^ ERROR: type annotations needed
|
2025-02-14 21:45:39 +00:00
|
|
|
_ = extract(x).max(2);
|
|
|
|
|
}
|