mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
22 lines
239 B
Rust
22 lines
239 B
Rust
//@ check-pass
|
|
|
|
trait Gen<T> {
|
|
fn gen(x: Self) -> T;
|
|
}
|
|
|
|
struct A;
|
|
|
|
impl Gen<[(); 0]> for A {
|
|
fn gen(x: Self) -> [(); 0] {
|
|
[]
|
|
}
|
|
}
|
|
|
|
fn array() -> impl Gen<[(); 0]> {
|
|
A
|
|
}
|
|
|
|
fn main() {
|
|
let [] = Gen::gen(array());
|
|
}
|