about summary refs log tree commit diff
path: root/tests/ui/const-generics/argument_order.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/argument_order.rs')
-rw-r--r--tests/ui/const-generics/argument_order.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/const-generics/argument_order.rs b/tests/ui/const-generics/argument_order.rs
new file mode 100644
index 00000000000..196d9b8a1e2
--- /dev/null
+++ b/tests/ui/const-generics/argument_order.rs
@@ -0,0 +1,15 @@
+struct Bad<const N: usize, T> {
+    arr: [u8; { N }],
+    another: T,
+}
+
+struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
+    //~^ ERROR lifetime parameters must be declared prior
+    a: &'a T,
+    b: &'b U,
+}
+
+fn main() {
+    let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
+    //~^ ERROR lifetime provided when a type was expected
+ }