allow unary operations and ignore StorageLive/Dead stmts
This commit is contained in:
parent
5a277822a5
commit
d1294e0ce2
2 changed files with 37 additions and 4 deletions
14
src/test/ui/const-generics/const_evaluatable_checked/unop.rs
Normal file
14
src/test/ui/const-generics/const_evaluatable_checked/unop.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// run-pass
|
||||
#![feature(const_generics, const_evaluatable_checked)]
|
||||
#![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<false> = test::<12>();
|
||||
let _: Foo<true> = test::<9>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue