Skip to content
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

ICE on call/deref of bottom #15965

Closed
bkoropoff opened this issue Jul 25, 2014 · 5 comments · Fixed by #17130
Closed

ICE on call/deref of bottom #15965

bkoropoff opened this issue Jul 25, 2014 · 5 comments · Fixed by #17130
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@bkoropoff
Copy link
Contributor

Code

fn main() {
    return { return () } ();
}

Output

test.rs:2:12: 2:28 error: multiple applicable methods in scope [E0034]
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #1 is `core::ops::fn() -> Result.FnMut<(), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #2 is `core::ops::fn(A0: A0) -> Result.FnMut<(A0,), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #3 is `core::ops::fn(A0: A0, A1: A1) -> Result.FnMut<(A0, A1), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #4 is `core::ops::fn(A0: A0, A1: A1, A2: A2) -> Result.FnMut<(A0, A1, A2), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #5 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3) -> Result.FnMut<(A0, A1, A2, A3), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #6 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3, A4: A4) -> Result.FnMut<(A0, A1, A2, A3, A4), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #7 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5) -> Result.FnMut<(A0, A1, A2, A3, A4, A5), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #8 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #9 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #10 is `core::ops::fn(A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8)
    -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #11 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #12 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #13 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10, A11: A11) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #14 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10, A11: A11, A12: A12) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #15 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10, A11: A11, A12: A12, A13: A13) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13), Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #16 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10, A11: A11, A12: A12, A13: A13, A14: A14) -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14),
      Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 note: candidate #17 is `core::ops::fn
    (A0: A0, A1: A1, A2: A2, A3: A3, A4: A4, A5: A5, A6: A6, A7: A7, A8: A8,
     A9: A9, A10: A10, A11: A11, A12: A12, A13: A13, A14: A14, A15: A15)
    -> Result.FnMut<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15),
      Result>::call_mut`
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
test.rs:2:12: 2:28 error: internal compiler error: &mut ! was a subtype of &mut fn() -> <generic #0> but now is not?
test.rs:2     return { return () } ();
                     ^~~~~~~~~~~~~~~~
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/bkoropoff/Source/rust/src/libsyntax/ast_util.rs:784

stack backtrace:
   1:     0x7fc590d8a890 - rt::backtrace::imp::write::hfc9a3eeca6becfa7J7p
   2:     0x7fc590d8db90 - failure::on_fail::h207b145abcb1be86Ysq
   3:     0x7fc591553c00 - unwind::begin_unwind_inner::h31ee34186ed144ecVTd
   4:     0x7fc58d608660 - unwind::begin_unwind::h3182066330090709700
   5:     0x7fc58d6085a0 - diagnostic::SpanHandler::span_bug::hec3e0cc32b293820p0C
   6:     0x7fc591ad5fd0 - driver::session::Session::span_bug::h2dbacbf3b5f10a225Qx
   7:     0x7fc591ed7670 - middle::typeck::check::method::LookupContext<'a>::bug::h822098f00e352717wzQ
   8:     0x7fc591ed7700 - middle::typeck::check::method::LookupContext<'a>::consider_candidates::h8005a88e5d219fe40GP
   9:     0x7fc591ed5280 - middle::typeck::check::method::LookupContext<'a>::search_for_method::h24a51267e373f9fcqBP
  10:     0x7fc591ed6930 - middle::typeck::check::method::LookupContext<'a>::search_for_some_kind_of_autorefd_method::hf1b4e5205b429638PuP
  11:     0x7fc591ed0090 - middle::typeck::check::method::LookupContext<'a>::search_for_autoptrd_method::ha1d862fd7dee0298tsP
  12:     0x7fc591ecef90 - middle::typeck::check::method::LookupContext<'a>::search_step::h6a067abc559e1565sBO
  13:     0x7fc591ecc3d0 - middle::typeck::check::method::LookupContext<'a>::search::he4b843362403cf7aVzO
  14:     0x7fc591ecd420 - middle::typeck::check::method::lookup_in_trait::h2dd16f8b92589564hpO
  15:     0x7fc591f20f00 - middle::typeck::check::check_expr_with_unifier::h490595390fe04f852IT
  16:     0x7fc591f20f00 - middle::typeck::check::check_expr_with_unifier::h490595390fe04f852IT
  17:     0x7fc591f829a0 - middle::typeck::check::check_stmt::h8f0b5746e66a5c3eKMV
  18:     0x7fc591eea5d0 - middle::typeck::check::check_block_with_expected::h798e07ed4f900ecaVQV
  19:     0x7fc591ee6030 - middle::typeck::check::check_fn::h136863052baa3867IZQ
  20:     0x7fc591ee5d50 - middle::typeck::check::check_bare_fn::h855041f1bc5c3416jPQ
  21:     0x7fc591eded00 - middle::typeck::check::check_item::h3372d8c113cb6225WnR
  22:     0x7fc591ee5b50 - middle::typeck::check::check_item_types::hace6547f392b091dBOQ
  23:     0x7fc59190f7a0 - util::common::time::h9504726944636004855
  24:     0x7fc592100160 - middle::typeck::check_crate::h67c61b23653b9589Kci
  25:     0x7fc5921d4c90 - driver::driver::phase_3_run_analysis_passes::h8152f29332f19308iJw
  26:     0x7fc5921cfbb0 - driver::driver::compile_input::hfe9d9d96ad380951Xuw
  27:     0x7fc59227ea30 - driver::run_compiler::h4cedc40f963c25efSEz
  28:     0x7fc59227e940 - driver::main_args::closure.$x22closure$x22$LP$138592$RP$
  29:     0x7fc592291d50 - task::TaskBuilder<S>::try_future::closure.$x22closure$x22$LP$139736$RP$
  30:     0x7fc592291b30 - task::TaskBuilder<S>::spawn_internal::closure.$x22closure$x22$LP$139713$RP$
  31:     0x7fc592c7a1b0 - task::spawn_opts::closure.$x22closure$x22$LP$8216$RP$
  32:     0x7fc5915aada0 - rust_try
  33:     0x7fc591550ee0 - unwind::try::h8ff3ad5ffa6101160Hd
  34:     0x7fc591550c40 - task::Task::run::h7ab33a0b74628f4aQSc
  35:     0x7fc592c79fa0 - task::spawn_opts::closure.$x22closure$x22$LP$8162$RP$
  36:     0x7fc591552cb0 - thread::thread_start::hd9ff33059d311002Ufd
  37:     0x7fc59082ee70 - start_thread
  38:     0x7fc591222db9 - clone
  39:                0x0 - <unknown>
@emberian
Copy link
Member

@pcwalton looks like there's some weirdness with overloaded call and bottom.

@bkoropoff
Copy link
Contributor Author

Program can be simplified further. Basically anything that tries to call bottom will blow up:

fn main() {
    (return ())();
}

@huonw huonw added the I-ICE label Jul 25, 2014
@huonw
Copy link
Member

huonw commented Jul 25, 2014

This is broken with normal methods and field accesses too, so I guess it's not necessarily due to overloaded calls specifically:

@bkoropoff bkoropoff changed the title ICE on rustc master ICE on call/deref of bottom Jul 25, 2014
@bkoropoff
Copy link
Contributor Author

Updated title to better reflect issue

@huonw
Copy link
Member

huonw commented Aug 3, 2014

This is very similar to #13847.

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.

3 participants