summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/associated-type-bound-fail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/associated-type-bound-fail.rs')
-rw-r--r--src/test/ui/const-generics/associated-type-bound-fail.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/associated-type-bound-fail.rs b/src/test/ui/const-generics/associated-type-bound-fail.rs
new file mode 100644
index 000000000..937b8bcb6
--- /dev/null
+++ b/src/test/ui/const-generics/associated-type-bound-fail.rs
@@ -0,0 +1,12 @@
+trait Bar<const N: usize> {}
+
+trait Foo<const N: usize> {
+ type Assoc: Bar<N>;
+}
+
+impl Bar<3> for u16 {}
+impl<const N: usize> Foo<N> for i16 {
+ type Assoc = u16; //~ ERROR the trait bound `u16: Bar<N>`
+}
+
+fn main() {}