Closed
Description
Compilation of this program produces an internal compiler error:
fn main() {
let triangle = ( [75], );
let mut sums = [0; 15];
sums[0] = triangle[0][0];
}
Backtrace:
problem_018.rs:7:15: 7:26 error: cannot index a value of type `([_; 1],)`
problem_018.rs:7 sums[0] = triangle[0][0];
^~~~~~~~~~~
error: internal compiler error: no type for node 29: expr 0 (id=29) in fcx 0x7f6b3dbecbb8
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
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:182
stack backtrace:
1: 0x7f6b456e5850 - sys::backtrace::write::h5b05e7b061a35107Czt
2: 0x7f6b45707a60 - failure::on_fail::h1e9b7e3de59488d1aPz
3: 0x7f6b456755e0 - rt::unwind::begin_unwind_inner::h23dcfb4c37870bd62tz
4: 0x7f6b4048a460 - rt::unwind::begin_unwind::h8180555736548804672
5: 0x7f6b4048ad10 - diagnostic::Handler::bug::hfea99a1512d774b6tWF
6: 0x7f6b439e20d0 - session::Session::bug::hda4aef05452f83daiRq
7: 0x7f6b44e1df80 - check::FnCtxt<'a, 'tcx>::node_ty::hd15e5fbb39eb4572xcm
8: 0x7f6b44e2f590 - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::h8a2bfc07a98e1301bEb
9: 0x7f6b44e2de30 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hd8ad1eaead247978bub
10: 0x7f6b44e2de30 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hd8ad1eaead247978bub
11: 0x7f6b44e2f490 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_block::hdcb765d26faad3efqvb
12: 0x7f6b44eb4360 - check::check_bare_fn::h12b646cb07f4b492H3j
13: 0x7f6b44eabad0 - check::check_item::h45ea87c7d5c5cf84umk
14: 0x7f6b44f79b30 - check_crate::unboxed_closure.30617
15: 0x7f6b44f74670 - check_crate::hdbcb36eaa379a57c23x
16: 0x7f6b45c349c0 - driver::phase_3_run_analysis_passes::h8c55e45fcfc1c7aegwa
17: 0x7f6b45c1d350 - driver::compile_input::h04aea004c559b910xba
18: 0x7f6b45cecfe0 - monitor::unboxed_closure.22497
19: 0x7f6b45cece40 - thunk::F.Invoke<A, R>::invoke::h11849311349984608396
20: 0x7f6b45cebbc0 - rt::unwind::try::try_fn::h13617610205470131813
21: 0x7f6b4576d6c0 - rust_try_inner
22: 0x7f6b4576d6b0 - rust_try
23: 0x7f6b45cebeb0 - thunk::F.Invoke<A, R>::invoke::h14452289732390470265
24: 0x7f6b456f5910 - sys::thread::thread_start::h93b0d38960a9fcacqrw
25: 0x7f6b3fca8100 - <unknown>
26: 0x7f6b4532d929 - clone
27: 0x0 - <unknown>
Rust version:
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e6eb22ec3c2a687fc156813577464017f7
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly