Skip to content

ICE in constant evaluation with function call #29587

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
eefriedman opened this issue Nov 4, 2015 · 2 comments
Closed

ICE in constant evaluation with function call #29587

eefriedman opened this issue Nov 4, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@eefriedman
Copy link
Contributor

fn f(x: usize) -> usize {
    x
}

const Y: usize = f(2);

fn main() {
    let z = [0; Y];
}
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: `(left == right)` (left: `NotConst`, right: `Const`)', ../src/librustc/middle/const_eval.rs:1067

Initially reported at https://github.com/rust-lang/rust/pull/26848/files#r43700207 .

CC @oli-obk .

@Manishearth Manishearth added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 5, 2015
@oli-obk
Copy link
Contributor

oli-obk commented Nov 5, 2015

I saw the comment on the merged PR and opened a fix-PR already :)

@dotdash
Copy link
Contributor

dotdash commented Nov 20, 2015

Fixed by #29534

@dotdash dotdash closed this as completed Nov 20, 2015
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

4 participants