]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/concrete-const-as-fn-arg.rs
Rollup merge of #106859 - tialaramex:master, r=Nilstrieb
[rust.git] / tests / ui / const-generics / concrete-const-as-fn-arg.rs
1 // Test that a concrete const type i.e. A<2>, can be used as an argument type in a function
2 // run-pass
3
4 struct A<const N: usize>; // ok
5
6 fn with_concrete_const_arg(_: A<2>) -> u32 { 17 }
7
8 fn main() {
9     let val: A<2> = A;
10     assert_eq!(with_concrete_const_arg(val), 17);
11 }