]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-fn-with-const-param.rs
Rollup merge of #79399 - pickfire:patch-3, r=JohnTitor
[rust.git] / src / test / ui / const-generics / const-fn-with-const-param.rs
1 // Checks that `const fn` with const params can be used.
2 // run-pass
3 // revisions: full min
4
5 #![cfg_attr(full, feature(const_generics))]
6 #![cfg_attr(full, allow(incomplete_features))]
7
8 const fn const_u32_identity<const X: u32>() -> u32 {
9     X
10 }
11
12 fn main() {
13     assert_eq!(const_u32_identity::<18>(), 18);
14 }