summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/const-fn-with-const-param.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/const-fn-with-const-param.rs')
-rw-r--r--tests/ui/const-generics/const-fn-with-const-param.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/const-generics/const-fn-with-const-param.rs b/tests/ui/const-generics/const-fn-with-const-param.rs
new file mode 100644
index 000000000..161bfaab4
--- /dev/null
+++ b/tests/ui/const-generics/const-fn-with-const-param.rs
@@ -0,0 +1,10 @@
+// Checks that `const fn` with const params can be used.
+// run-pass
+
+const fn const_u32_identity<const X: u32>() -> u32 {
+ X
+}
+
+fn main() {
+ assert_eq!(const_u32_identity::<18>(), 18);
+}