diff options
Diffstat (limited to 'tests/ui/consts/issue-79152-const-array-index.rs')
-rw-r--r-- | tests/ui/consts/issue-79152-const-array-index.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/consts/issue-79152-const-array-index.rs b/tests/ui/consts/issue-79152-const-array-index.rs new file mode 100644 index 000000000..95518e1bb --- /dev/null +++ b/tests/ui/consts/issue-79152-const-array-index.rs @@ -0,0 +1,11 @@ +// check-pass +// Regression test for issue #79152 +// +// Tests that we can index an array in a const function + +const fn foo() { + let mut array = [[0; 1]; 1]; + array[0][0] = 1; +} + +fn main() {} |