rust/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs

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

19 lines
412 B
Rust
Raw Normal View History

2021-06-08 07:02:12 +00:00
// check-pass
#![feature(generic_const_exprs)]
2021-06-08 07:02:12 +00:00
#![allow(incomplete_features)]
struct Foo<const N: u8>([u8; N as usize])
where
[(); N as usize]:;
2021-06-10 13:53:38 +00:00
struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:;
// 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 07:02:12 +00:00
fn main() {}