]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-fn-with-const-param.rs
Rollup merge of #75485 - RalfJung:pin, r=nagisa
[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 #![cfg_attr(min, feature(min_const_generics))]
8
9 const fn const_u32_identity<const X: u32>() -> u32 {
10     X
11 }
12
13 fn main() {
14     assert_eq!(const_u32_identity::<18>(), 18);
15 }