Closed
Description
Code:
enum E { A, }
const C: [u32; 1] = [1];
fn main() {
let a = C[E::A as usize];
}
Error message:
<anon>:6:9: 6:10 warning: unused variable: `a`, #[warn(unused_variables)] on by default
<anon>:6 let a = C[E::A as usize];
^
<anon>:6:15: 6:28 error: internal compiler error: index is not an integer-constant expression
<anon>:6 let a = C[E::A as usize];
^~~~~~~~~~~~~
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 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130