1
Fork 0
rust/src/test/ui/const-generics/generic_const_exprs/less_than.rs

15 lines
296 B
Rust
Raw Normal View History

2020-09-10 09:06:30 +02:00
// run-pass
#![feature(const_generics, generic_const_exprs)]
2020-09-10 09:06:30 +02:00
#![allow(incomplete_features)]
struct Foo<const B: bool>;
fn test<const N: usize>() -> Foo<{ N > 10 }> where Foo<{ N > 10 }>: Sized {
Foo
}
fn main() {
let _: Foo<true> = test::<12>();
let _: Foo<false> = test::<9>();
}