Closed
Description
This code:
fn main() {
println!("{:?}", &[()][0]);
}
gives this ICE:
error: internal compiler error: /checkout/src/librustc_trans/mir/lvalue.rs:301: using operand local _10 as lvalue
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: rustc 1.20.0-nightly (f85579d4a 2017-07-12) running on x86_64-unknown-linux-gnu
thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:489:8
Doesn't happen if you use e.g. 1
instead of ()
, or use (&[()])
instead of [()]
.