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 [()]
.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Mark-Simulacrum commentedon Jul 19, 2017
Minimized to:
Fixes issue rust-lang#43205: ICE in Rvalue::Len evaluation.
Auto merge of #44060 - taleks:issue-43205, r=arielb1
goffrie commentedon Aug 29, 2017
Fixed in #44060.