diff options
Diffstat (limited to 'src/test/ui/const-generics/const-fn-with-const-param.rs')
-rw-r--r-- | src/test/ui/const-generics/const-fn-with-const-param.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const-fn-with-const-param.rs b/src/test/ui/const-generics/const-fn-with-const-param.rs new file mode 100644 index 000000000..161bfaab4 --- /dev/null +++ b/src/test/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); +} |