diff options
Diffstat (limited to 'tests/ui/inline-const/const-expr-generic-err.rs')
-rw-r--r-- | tests/ui/inline-const/const-expr-generic-err.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/inline-const/const-expr-generic-err.rs b/tests/ui/inline-const/const-expr-generic-err.rs new file mode 100644 index 000000000..4e8879af5 --- /dev/null +++ b/tests/ui/inline-const/const-expr-generic-err.rs @@ -0,0 +1,15 @@ +// build-fail +#![feature(inline_const)] + +fn foo<T>() { + const { assert!(std::mem::size_of::<T>() == 0); } //~ ERROR E0080 +} + +fn bar<const N: usize>() -> usize { + const { N - 1 } //~ ERROR E0080 +} + +fn main() { + foo::<i32>(); + bar::<0>(); +} |