summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/ct-var-in-collect_all_mismatches.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/consts/ct-var-in-collect_all_mismatches.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/consts/ct-var-in-collect_all_mismatches.rs b/tests/ui/consts/ct-var-in-collect_all_mismatches.rs
new file mode 100644
index 000000000..5fb633de9
--- /dev/null
+++ b/tests/ui/consts/ct-var-in-collect_all_mismatches.rs
@@ -0,0 +1,20 @@
+struct Foo<T, const N: usize> {
+ array: [T; N],
+}
+
+trait Bar<const N: usize> {}
+
+impl<T, const N: usize> Foo<T, N> {
+ fn trigger(self) {
+ self.unsatisfied()
+ //~^ ERROR the trait bound `T: Bar<N>` is not satisfied
+ }
+
+ fn unsatisfied(self)
+ where
+ T: Bar<N>,
+ {
+ }
+}
+
+fn main() {}