-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #79427 - Aaron1011:fix/const-array-index, r=oli-obk
Resolve inference variables before trying to remove overloaded indexing Fixes #79152 This code was already set up to handle indexing an array. However, it appears that we never end up with an inference variable for the slice case, so the missing call to `resolve_vars_if_possible` had no effect until now.
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |