]>
Commit | Line | Data |
---|---|---|
6a06907d | 1 | // run-pass |
6a06907d XL |
2 | |
3 | // This test unsures that with_opt_const_param returns the | |
4 | // def_id of the N param in the Foo::Assoc GAT. | |
5 | ||
6 | trait Foo { | |
7 | type Assoc<const N: usize>; | |
8 | fn foo(&self) -> Self::Assoc<3>; | |
9 | } | |
10 | ||
11 | impl Foo for () { | |
12 | type Assoc<const N: usize> = [(); N]; | |
13 | fn foo(&self) -> Self::Assoc<3> { | |
14 | [(); 3] | |
15 | } | |
16 | } | |
17 | ||
18 | fn main() { | |
19 | assert_eq!(().foo(), [(); 3]); | |
20 | } |