]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / const-generics-gat-in-trait-return-type-1.rs
CommitLineData
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
6trait Foo {
7 type Assoc<const N: usize>;
8 fn foo(&self) -> Self::Assoc<3>;
9}
10
11impl Foo for () {
12 type Assoc<const N: usize> = [(); N];
13 fn foo(&self) -> Self::Assoc<3> {
14 [(); 3]
15 }
16}
17
18fn main() {
19 assert_eq!(().foo(), [(); 3]);
20}