2021-06-08 02:02:12 -05:00
|
|
|
// check-pass
|
2021-08-27 11:04:57 -05:00
|
|
|
#![feature(generic_const_exprs)]
|
2021-06-08 02:02:12 -05:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
struct Foo<const N: u8>([u8; N as usize])
|
|
|
|
where
|
|
|
|
[(); N as usize]:;
|
|
|
|
|
2021-06-10 08:53:38 -05:00
|
|
|
struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:;
|
2021-06-09 13:28:41 -05:00
|
|
|
|
|
|
|
// unifying with subtrees
|
|
|
|
struct Evaluatable<const N: u16>;
|
|
|
|
fn foo<const N: u8>() where Evaluatable<{N as usize as u16 }>: {
|
|
|
|
let _ = Foo::<N>([1; N as usize]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-08 02:02:12 -05:00
|
|
|
fn main() {}
|