diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-09-11 10:00:06 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-09-18 17:11:34 +0200 |
| commit | d1294e0ce2ce78e4a634fbfa68cb2bc4d50afc6e (patch) | |
| tree | f32d9289e39c862d70cb15bd15b38e3e20118cd5 /src | |
| parent | 5a277822a536eff72d562e75fb6046add63d4926 (diff) | |
| download | rust-d1294e0ce2ce78e4a634fbfa68cb2bc4d50afc6e.tar.gz rust-d1294e0ce2ce78e4a634fbfa68cb2bc4d50afc6e.zip | |
allow unary operations and ignore StorageLive/Dead stmts
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/const-generics/const_evaluatable_checked/unop.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unop.rs b/src/test/ui/const-generics/const_evaluatable_checked/unop.rs new file mode 100644 index 00000000000..8e0768b1c95 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/unop.rs @@ -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>(); +} |
