Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 04c7af3

Browse files
authored
Merge pull request #1328 from matthiaskrgr/branch
2 parents c1dd042 + 03f241b commit 04c7af3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ices/98702.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#![feature(generic_associated_types)]
2+
3+
struct Node<T, const N : usize, const P : usize> {
4+
data : [[T; N]; P]
5+
}
6+
7+
trait NodeT<const N : usize> {
8+
type Node<T>;
9+
}
10+
11+
struct NodeLookup;
12+
13+
macro_rules! impl_lookup {
14+
($($n:literal)*) => { $(
15+
impl NodeT<$n> for NodeLookup {
16+
type Node<T> = Node<T, $n, {$n*$n}>;
17+
}
18+
)* }
19+
}
20+
21+
impl_lookup!(1 2 3 4);
22+
23+
fn main() {}

0 commit comments

Comments
 (0)