Closed
Description
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 .