rust/tests/ui/const-generics/const-fn-with-const-param.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
194 B
Rust
Raw Normal View History

// Checks that `const fn` with const params can be used.
2020-04-13 15:32:40 -05:00
// run-pass
const fn const_u32_identity<const X: u32>() -> u32 {
X
}
fn main() {
2020-04-13 15:32:40 -05:00
assert_eq!(const_u32_identity::<18>(), 18);
}