2021-04-18 08:14:17 -05:00
|
|
|
// run-pass
|
|
|
|
struct Foo<const N: usize, const M: usize = N>([u8; N], [u8; M]);
|
|
|
|
|
|
|
|
fn foo<const N: usize>() -> Foo<N> {
|
|
|
|
let x = [0; N];
|
|
|
|
Foo(x, x)
|
|
|
|
}
|
|
|
|
|
2021-04-18 09:43:43 -05:00
|
|
|
// To check that we actually apply the correct substs for const param defaults.
|
|
|
|
fn concrete_foo() -> Foo<13> {
|
|
|
|
Foo(Default::default(), Default::default())
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-18 08:14:17 -05:00
|
|
|
fn main() {
|
|
|
|
let val = foo::<13>();
|
|
|
|
assert_eq!(val.0, val.1);
|
2021-04-18 09:43:43 -05:00
|
|
|
|
|
|
|
let val = concrete_foo();
|
|
|
|
assert_eq!(val.0, val.1);
|
2021-04-18 08:14:17 -05:00
|
|
|
}
|