Closed
Description
Testcase:
static mut TEST: [isize; 1] = [1];
static mut TEST2: &'static mut [isize] = unsafe { &mut TEST };
fn main() {
println!("{}", unsafe { TEST2[0] });
}
Produces:
<anon>:2:56: 2:60 error: internal compiler error: expected a const, fn, struct, or variant def
<anon>:2 static mut TEST2: &'static mut [isize] = unsafe { &mut TEST };
^~~~
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:176