summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/associated-type-bound.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/associated-type-bound.rs')
-rw-r--r--src/test/ui/const-generics/associated-type-bound.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/associated-type-bound.rs b/src/test/ui/const-generics/associated-type-bound.rs
new file mode 100644
index 000000000..3044736b4
--- /dev/null
+++ b/src/test/ui/const-generics/associated-type-bound.rs
@@ -0,0 +1,19 @@
+// run-pass
+trait Bar<const N: usize> {}
+
+trait Foo<const N: usize> {
+ type Assoc: Bar<N>;
+}
+
+impl<const N: usize> Bar<N> for u8 {}
+impl Bar<3> for u16 {}
+
+impl<const N: usize> Foo<N> for i8 {
+ type Assoc = u8;
+}
+
+impl Foo<3> for i16 {
+ type Assoc = u16;
+}
+
+fn main() {}