Skip to content

ICE: array index on wrong field #20752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klutzy opened this issue Jan 8, 2015 · 0 comments · Fixed by #20897
Closed

ICE: array index on wrong field #20752

klutzy opened this issue Jan 8, 2015 · 0 comments · Fixed by #20897
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@klutzy
Copy link
Contributor

klutzy commented Jan 8, 2015

fn main() {
    1u8.t[0] = 3;
}
i.rs:2:5: 2:10 error: attempted access of field `t` on type `u8`, but no field with that name was found
i.rs:2     1u8.t[0] = 3;
           ^~~~~
error: internal compiler error: no type for node 13: expr 0 (id=13) in fcx 0x7f443ebec2e8
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:     0x7f444691a410 - sys::backtrace::write::hb159f9850e834894l1s
   2:     0x7f444693f150 - failure::on_fail::hd4fb51e7b66e269fxgz
   3:     0x7f44468a4f20 - rt::unwind::begin_unwind_inner::he95e3015bc1198c6tVy
   4:     0x7f4441618dd0 - rt::unwind::begin_unwind::h1691522525006698826
   5:     0x7f4441619680 - diagnostic::Handler::bug::hc6d3941020c8b0a7kKF
   6:     0x7f4444b94bd0 - session::Session::bug::hfb58b153044b1728Zcq
   7:     0x7f4446006410 - check::FnCtxt<'a, 'tcx>::node_ty::h7670ee419242b676dGl
   8:     0x7f444601a5b0 - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::h079bbe8f80d97b53kEb
   9:     0x7f4446016840 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h7c6a52b2b65c87a3kub
  10:     0x7f444601a4b0 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_block::hddf3bfdc17a224b0zvb
  11:     0x7f44460b70f0 - check::check_bare_fn::h368991e084d6817flzj
  12:     0x7f44460ae840 - check::check_item::hcbf00dd224aa026f7Rj
  13:     0x7f44461a2ae0 - check_crate::unboxed_closure.40379
  14:     0x7f444619d720 - check_crate::h3f64d3a4a846d0b2Nrx
  15:     0x7f4446e5acd0 - driver::phase_3_run_analysis_passes::had0a81b4c9f8a9cd6va
  16:     0x7f4446e48b50 - driver::compile_input::h4f21f66f6761bb22vba
  17:     0x7f4446f11640 - thunk::F.Invoke<A, R>::invoke::h1208443586143045988
  18:     0x7f4446f103f0 - rt::unwind::try::try_fn::h4735177180287591181
  19:     0x7f44469a3810 - rust_try_inner
  20:     0x7f44469a3800 - rust_try
  21:     0x7f4446f10740 - thunk::F.Invoke<A, R>::invoke::h6623100047367797814
  22:     0x7f444692b3d0 - sys::thread::thread_start::h89f54a8cba556c09RSv
  23:     0x7f4440e39fe0 - start_thread
  24:     0x7f4446554c99 - __clone
  25:                0x0 - <unknown>

Similar to #20506?

(tested with rustc ea6f65c / 2015-01-06 19:47:08 +0000)

@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 8, 2015
barosl added a commit to barosl/rust that referenced this issue Jan 11, 2015
If the type of a node cannot be determined due to a previous type error,
a "no type for node" ICE occurs. This commit makes it return ty_err
instead in such a case.

Fixes rust-lang#20401.
Fixes rust-lang#20506.
Fixes rust-lang#20614.
Fixes rust-lang#20752.
Fixes rust-lang#20829.
Fixes rust-lang#20846.
Fixes rust-lang#20885.
Fixes rust-lang#20886.
bors added a commit that referenced this issue Jan 12, 2015
If the type of a node cannot be determined due to a previous type error, a `no type for node` ICE occurs. This commit makes it return `ty_err` instead in such a case.

Fixes #20401.
Fixes #20506.
Fixes #20614.
Fixes #20752.
Fixes #20829.
Fixes #20846.
Fixes #20885.
Fixes #20886.
Fixes #20952.
Fixes #20970.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants