Skip to content

ICE Struct += Struct #19337

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
japaric opened this issue Nov 26, 2014 · 3 comments
Closed

ICE Struct += Struct #19337

japaric opened this issue Nov 26, 2014 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@japaric
Copy link
Member

japaric commented Nov 26, 2014

STR

struct Struct;

fn main() {
    Struct += Struct;
}

Output

ice.rs:4:5: 4:21 error: binary assignment operation `+=` cannot be applied to type `Struct`
ice.rs:4     Struct += Struct;
             ^~~~~~~~~~~~~~~~
error: internal compiler error: node_id_to_type: no type for node `expr Struct (id=13)`
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
task 'rustc' panicked at 'Box<Any>', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/diagnostic.rs:180

stack backtrace:
   1:     0x7f7c8a53c210 - rt::backtrace::imp::write::h42dbac067ddfb84aK9x
   2:     0x7f7c8a53f2e0 - <unknown>
   3:     0x7f7c8a19c500 - unwind::begin_unwind_inner::h097035e7a55425d6YQc
   4:     0x7f7c880a3150 - <unknown>
   5:     0x7f7c880a3880 - diagnostic::Handler::bug::h66c514572f1833beW9F
   6:     0x7f7c88ef4410 - middle::ty::node_id_to_type::he348e5f01af17731ux6
   7:     0x7f7c890a6700 - middle::ty::expr_kind::hf3b8f186852d9e6bN26
   8:     0x7f7c891e4670 - <unknown>
   9:     0x7f7c8921b0b0 - middle::typeck::check::check_stmt::h95b51f23e662710fTUq
  10:     0x7f7c8919cde0 - <unknown>
  11:     0x7f7c89174cd0 - <unknown>
  12:     0x7f7c89199760 - <unknown>
  13:     0x7f7c891955d0 - middle::typeck::check::check_item::ha5af42104de2c03d8yl
  14:     0x7f7c891993f0 - middle::typeck::check::check_item_types::hc79bceba3c09db148dl
  15:     0x7f7c8953ccc0 - <unknown>
  16:     0x7f7c8953bed0 - middle::typeck::check_crate::ha9e443d271ae4b87PVO
  17:     0x7f7c8ab5dd00 - driver::driver::phase_3_run_analysis_passes::h3348c824d854c9b8VlS
  18:     0x7f7c8ab52d80 - driver::driver::compile_input::h96cfcd1fc8f6fbdd12R
  19:     0x7f7c8abd6cb0 - <unknown>
  20:     0x7f7c8abd6ba0 - <unknown>
  21:     0x7f7c8a9ded20 - <unknown>
  22:     0x7f7c8a50ce70 - <unknown>
  23:     0x7f7c8a19a2e0 - <unknown>
  24:     0x7f7c8a1eaf50 - <unknown>
  25:     0x7f7c8a1eaf40 - rust_try
  26:     0x7f7c8a19a3c0 - unwind::try::h76b36eb90468baffjFc
  27:     0x7f7c8a19a180 - task::Task::run::haf51cb923e41a2c8cOb
  28:     0x7f7c8a199d70 - <unknown>
  29:     0x7f7c8a19b7c0 - <unknown>
  30:     0x7f7c851081a0 - start_thread
  31:     0x7f7c89e72379 - clone
  32:                0x0 - <unknown>

Version

rustc 0.13.0-dev (8fb027e39 2014-11-26 12:02:16 +0000)

Maybe related to #9307 (see #9307 (comment)), but AFAIK += is not a lang item.

@arielb1
Copy link
Contributor

arielb1 commented Nov 26, 2014

This isn't related to #9307.

This is an issue with = too.

Good backtrace:

stack backtrace:
   1:     0x7f1548a63ed0 - rt::backtrace::imp::write::h1c9c1ea877e5edc5K9x
   2:     0x7f1548a65f40 - failure::on_fail::h284073a486443c413By
   3:     0x7f15486c7c30 - unwind::begin_unwind_inner::hb0b35e2abeecf1a6YQc
   4:     0x7f15467e4d90 - unwind::begin_unwind::h10120921747425399695
   5:     0x7f15467e5340 - diagnostic::Handler::bug::he23fca87e418c598W9F
   6:     0x7f15475a1ee0 - session::Session::bug::h0bef21eaae734aa1BV3
   7:     0x7f15475d1f30 - middle::ty::node_id_to_type::ha1dec8b17686be2aux6
   8:     0x7f1547767690 - middle::ty::expr_kind::h2dfd650c41f03ea7N26
   9:     0x7f154787b870 - middle::typeck::check::check_expr_with_unifier::h8851395bac412942sZo
  10:     0x7f15478a9410 - middle::typeck::check::check_stmt::h09bff7b86c2f7383TUq
  11:     0x7f154783d3d0 - middle::typeck::check::check_block_with_expected::hdf2f1eaf1eed2e398Yq
  12:     0x7f154781a740 - middle::typeck::check::check_fn::h6f9e6e1dfabffe15Tpl
  13:     0x7f1547838cd0 - middle::typeck::check::check_bare_fn::hd8e6e1e72f752c55Yel
  14:     0x7f15478354f0 - middle::typeck::check::check_item::hf04c986f355a71328yl
  15:     0x7f1547838a10 - middle::typeck::check::check_item_types::he31957e62cc70b4d8dl
  16:     0x7f1547b32ab0 - util::common::time::h12934209058077514157
  17:     0x7f1547b31fa0 - middle::typeck::check_crate::h771a6cf74a1cf458PVO
  18:     0x7f154903bea0 - driver::driver::phase_3_run_analysis_passes::h23fb9d0bb1403e07VlS
  19:     0x7f1549032980 - driver::driver::compile_input::h776cb21295573b2712R
  20:     0x7f15490b9550 - driver::run::closure.59799
  21:     0x7f1548eebde0 - task::TaskBuilder::try_future::closure.38979
  22:     0x7f1548a3e1b0 - task::TaskBuilder::spawn_internal::closure.30287
  23:     0x7f15486c6220 - task::Task::spawn::closure.5717
  24:     0x7f15487286b0 - rust_try_inner
  25:     0x7f15487286a0 - rust_try
  26:     0x7f15486c6120 - task::Task::run::hdca98e8b61eea237cOb
  27:     0x7f15486c5d70 - task::Task::spawn::closure.5693
  28:     0x7f15486c7200 - thread::thread_start::hbd8823507422f48cf6b
  29:     0x7f15439fafe0 - start_thread
  30:     0x7f1548395c99 - __clone
  31:                0x0 - <unknown>

@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 26, 2014
@Twisol
Copy link

Twisol commented Jan 4, 2015

This no longer causes an ICE.

foo.rs:4:5: 4:21 error: binary assignment operation `+=` cannot be applied to type `Struct`
foo.rs:4     Struct += Struct;
             ^~~~~~~~~~~~~~~~
foo.rs:4:5: 4:11 error: illegal left-hand side expression [E0067]
foo.rs:4     Struct += Struct;
             ^~~~~~
error: aborting due to 2 previous errors
rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)
binary: rustc
commit-hash: c6c786671d692d7b13c2e5c68a53001327b4b125
commit-date: 2015-01-04 00:50:59 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly

@kmcallister
Copy link
Contributor

Confirmed on

rustc 0.13.0-dev (84f5ad867 2014-12-30 17:51:21 +0000)
binary: rustc
commit-hash: 84f5ad8679c7fc454473ffbf389030f3e5fee379
commit-date: 2014-12-30 17:51:21 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-dev

lnicola pushed a commit to lnicola/rust that referenced this issue Apr 28, 2025
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.

5 participants