summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/typod-const-in-const-param-def.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/typod-const-in-const-param-def.rs')
-rw-r--r--tests/ui/parser/typod-const-in-const-param-def.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/parser/typod-const-in-const-param-def.rs b/tests/ui/parser/typod-const-in-const-param-def.rs
new file mode 100644
index 000000000..85d3ebba5
--- /dev/null
+++ b/tests/ui/parser/typod-const-in-const-param-def.rs
@@ -0,0 +1,16 @@
+pub fn foo<Const N: u8>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn bar<Const>() {}
+// OK
+
+pub fn baz<Const N: u8, T>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn qux<T, Const N: u8>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn quux<T, Const N: u8, U>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+fn main() {}