summary refs log tree commit diff
path: root/src/test/ui/const-generics/const-fn-with-const-param.rs
blob: add1290b1d9758a6fcb0235d686c4d1d04ab008e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Checks that `const fn` with const params can be used.
// run-pass
// revisions: full min

#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

const fn const_u32_identity<const X: u32>() -> u32 {
    X
}

fn main() {
    assert_eq!(const_u32_identity::<18>(), 18);
}