Skip to content

ICE when initiating an array using static for size #16382

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

Closed
anmej opened this issue Aug 9, 2014 · 2 comments
Closed

ICE when initiating an array using static for size #16382

anmej opened this issue Aug 9, 2014 · 2 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@anmej
Copy link

anmej commented Aug 9, 2014

static SIZE: int = 25;

fn main() {
    let mut map: [int, ..SIZE as uint] = [1, ..SIZE as uint];
}

This produces the following message:

error: internal compiler error: node_id_to_type: no type for node `expr SIZE (id=17)`
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/ast_util.rs:784

This, hovewer, works:

static SIZE: uint = 25;

fn main() {
    let mut map: [int, ..SIZE] = [1, ..SIZE];
}

rustc version: 0.12.0-pre-nightly (7be8f0a 2014-08-07 02:26:07 +0000)
OS: Mac OS X 10.9.4

@Sawyer47
Copy link
Contributor

No longer causes ICE. Probably related to #10618 (as it also no longer causes ICE for me)

@alexcrichton
Copy link
Member

Flagging as needstest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants