Skip to content

Internal compiler error #15260

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
fmendez opened this issue Jun 30, 2014 · 1 comment · Fixed by #15262
Closed

Internal compiler error #15260

fmendez opened this issue Jun 30, 2014 · 1 comment · Fixed by #15262
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@fmendez
Copy link

fmendez commented Jun 30, 2014

I was playing around with some simple code and after making a mistake (typo) and trying to compile it I a got some "semi-ambiguous" error message. The first part helped me to identify the issue while the second part did confused me a bit.

struct Person {
  age: uint,
  phone:uint,
}

fn main(){
  let fernando = Person {age:29, phone:456};

  let age = {
    let Person {age: ref my_age, age: _} = fernando;
    my_age
  }; 

  println!("{}",age);
}
test.rs:15:9: 15:41 error: field `age` bound twice in pattern
test.rs:15     let Person {age: ref my_age, age: _} = fernando;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.rs:15:9: 15:41 error: pattern does not mention field `phone`
test.rs:15     let Person {age: ref my_age, age: _} = fernando;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: internal compiler error: no type for node 32: pat _ (id=32) in fcx 0x113daad28
note: the compiler hit an unexpected failure path. 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' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:163

I ran this thru several folks at the rust IRC and they suggested the report.

@huonw huonw added the A-ARM label Jun 30, 2014
@nathantypanski
Copy link
Contributor

Simpler test:

struct Foo {
  a: uint,
}

fn main(){
  let bar = Foo {a: 29};

  let baz = {
    let Foo {a: _, a: _} = bar;
  };
}

Backtrace:

$ RUST_BACKTRACE=1 rustc ice.rs
ice.rs:9:9: 9:25 error: field `a` bound twice in pattern
ice.rs:9     let Foo {a: _, a: _} = bar;
                 ^~~~~~~~~~~~~~~~
error: internal compiler error: no type for node 28: pat _ (id=28) in fcx 0x7f5e08fefad8
note: the compiler hit an unexpected failure path. 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' failed at 'Box<Any>', /home/nathan/devel/rust/rust/src/libsyntax/diagnostic.rs:163

stack backtrace:
   1:     0x7f5e0ae9bdf0 - rt::backtrace::imp::write::h108d0991ca026317UGp::v0.11.0.pre
   2:     0x7f5e0aea2920 - failure::on_fail::he2a6dc919a12a36691p::v0.11.0.pre
   3:     0x7f5e0cfe6ae0 - unwind::begin_unwind_inner::h08f08f512eb17f89cZd::v0.11.0.pre
   4:     0x7f5e0b9d1440 - unwind::begin_unwind::h13260005051934678122::v0.11.0.pre
   5:     0x7f5e0b9d1de0 - diagnostic::Handler::bug::h0882f89fc46fc1f1Pcc::v0.11.0.pre
   6:     0x7f5e0d95c040 - driver::session::Session::bug::he3dbad1ac7e3e51eG5q::v0.11.0.pre
   7:     0x7f5e0dbdff00 - middle::typeck::check::FnCtxt<'a>::node_ty::hf6396e49799c2931iwe::v0.11.0.pre
   8:     0x7f5e0dc0cb50 - middle::typeck::check::writeback::WritebackCx<'cx>::visit_node_id::h17bb9920cdaade20Zs7::v0.11.0.pre
   9:     0x7f5e0dc0c620 - middle::typeck::check::writeback::WritebackCx<'cx>.Visitor<(*>::visit_pat::hdedc2230fb7b55231k7::v0.11.0.pre
  10:     0x7f5e0dc0c620 - middle::typeck::check::writeback::WritebackCx<'cx>.Visitor<(*>::visit_pat::hdedc2230fb7b55231k7::v0.11.0.pre
  11:     0x7f5e0dc10360 - middle::typeck::check::writeback::WritebackCx<'cx>.Visitor<(*>::visit_local::hf0efa79175ff7e1ceo7::v0.11.0.pre
  12:     0x7f5e0dc13e30 - visit::walk_block::h14268814427612348425::v0.11.0.pre
  13:     0x7f5e0dc10360 - middle::typeck::check::writeback::WritebackCx<'cx>.Visitor<(*>::visit_local::hf0efa79175ff7e1ceo7::v0.11.0.pre
  14:     0x7f5e0dc13e30 - visit::walk_block::h14268814427612348425::v0.11.0.pre
  15:     0x7f5e0dc0c330 - middle::typeck::check::writeback::resolve_type_vars_in_fn::h514f032f67c0638fQc7::v0.11.0.pre
  16:     0x7f5e0dc6c4c0 - middle::typeck::check::check_bare_fn::hfca1b44af4ea2f6cRJc::v0.11.0.pre
  17:     0x7f5e0dc65f10 - middle::typeck::check::check_item::hb7411e26fcaa75d45gd::v0.11.0.pre
  18:     0x7f5e0dc6c2c0 - middle::typeck::check::check_item_types::hff3da1dc9ec71e4a9Ic::v0.11.0.pre
  19:     0x7f5e0dde9850 - middle::typeck::check_crate::h27a4add4caf7a098SJC::v0.11.0.pre
  20:     0x7f5e0e261c30 - driver::driver::phase_3_run_analysis_passes::hee64a98da1762f5a84p::v0.11.0.pre
  21:     0x7f5e0e25d1e0 - driver::driver::compile_input::h426af5bcce52e33f6Rp::v0.11.0.pre
  22:     0x7f5e0e329f90 - driver::run_compiler::h5bd01faab2919e705Bs::v0.11.0.pre
  23:     0x7f5e0e329ea0 - driver::main_args::closure.117253
  24:     0x7f5e0e33efc0 - task::TaskBuilder<S>::try_future::closure.118393
  25:     0x7f5e0e33ebe0 - task::TaskBuilder<S>::spawn_internal::closure.118370
  26:     0x7f5e0d344ca0 - task::spawn_opts::closure.7461
  27:     0x7f5e0d047140 - rust_try
  28:     0x7f5e0cfe30f0 - unwind::try::h442319c5f595eac5BNd::v0.11.0.pre
  29:     0x7f5e0cfe2dd0 - task::Task::run::h493de1a4392e540eXYc::v0.11.0.pre
  30:     0x7f5e0d344a60 - task::spawn_opts::closure.7407
  31:     0x7f5e0cfe5990 - thread::thread_start::h62060143786fc79bvld::v0.11.0.pre
  32:     0x7f5e0a913000 - start_thread
  33:     0x7f5e0ccaefc9 - __clone
  34:                0x0 - <unknown>

@alexcrichton alexcrichton added I-ICE and removed A-ARM labels Jun 30, 2014
bors added a commit that referenced this issue Jun 30, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 17, 2023
…e-3, r=lowr

internal: Migrate assists to the structured snippet API, part 3

Continuing from rust-lang#15231

Migrates the following assists:
- `add_missing_match_arms`
- `fix_visibility`
- `promote_local_to_const`

The `add_missing_match_arms` changes are best reviewed commit-by-commit since they're relatively big changes compared to the rest of the commits.
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 16, 2023
…e-4, r=Veykril

internal: Migrate assists to the structured snippet API, part 4

Continuing from rust-lang#15260

Migrates the following assists:
- `add_turbo_fish`
- `add_type_ascription`
- `destructure_tuple_binding`
- `destructure_tuple_binding_in_subpattern`

I did this a while ago, but forgot to make a PR for the changes until now. 😅
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.

4 participants