diff options
Diffstat (limited to 'src/test/ui/inline-const/const-expr-generic-err2.rs')
-rw-r--r-- | src/test/ui/inline-const/const-expr-generic-err2.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/inline-const/const-expr-generic-err2.rs b/src/test/ui/inline-const/const-expr-generic-err2.rs new file mode 100644 index 000000000..e097cbe9d --- /dev/null +++ b/src/test/ui/inline-const/const-expr-generic-err2.rs @@ -0,0 +1,10 @@ +#![feature(inline_const)] + +fn foo<T>() { + let _ = [0u8; const { std::mem::size_of::<T>() }]; + //~^ ERROR: constant expression depends on a generic parameter +} + +fn main() { + foo::<i32>(); +} |