Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE on using result of index operation on a constant to index into a constant #29914

Closed
oli-obk opened this issue Nov 18, 2015 · 0 comments
Closed
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Nov 18, 2015

const ARR: [usize; 5] = [5, 4, 3, 2, 1];

fn main() {
    println!("{}", ARR[ARR[3]]);
}

causes

<anon>:5:24: 5:30 error: internal compiler error: index is not an integer-constant expression
<anon>:5     println!("{}", ARR[ARR[3]]);
                                ^~~~~~
@apasel422 apasel422 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 18, 2015
wesleywiser added a commit to wesleywiser/rust that referenced this issue Jan 6, 2016
The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes rust-lang#29914
bors added a commit that referenced this issue Jan 6, 2016
The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes #29914
wesleywiser added a commit to wesleywiser/rust that referenced this issue Feb 13, 2016
The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes rust-lang#29914
bors added a commit that referenced this issue Feb 16, 2016
The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes #29914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants