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

internal compiler error: unexpected callee type #21701

Closed
istankovic opened this issue Jan 27, 2015 · 1 comment
Closed

internal compiler error: unexpected callee type #21701

istankovic opened this issue Jan 27, 2015 · 1 comment
Labels
E-needs-test Call for participation: Writing correctness tests. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@istankovic
Copy link
Contributor

fn foo<U>(t: U) {
    let y = t();
}

pub fn main() {
    foo(|| { 1 });
}

results in

a.rs:2:13: 2:16 error: expected function, found `U`
a.rs:2     let y = t();
                   ^~~
a.rs:2:13: 2:14 error: internal compiler error: unexpected callee type U
a.rs:2     let y = t();
                   ^
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:130

stack backtrace:
   1:     0x7f7bc5e2baf0 - sys::backtrace::write::ha1285e6ad7009234SZt
   2:     0x7f7bc5e4dd60 - failure::on_fail::he2e581bffa6b3e43LdA
   3:     0x7f7bc5dbc3b0 - rt::unwind::begin_unwind_inner::hc22dd6e06baffeb3MSz
   4:     0x7f7bc088fdf0 - rt::unwind::begin_unwind::h14850417801730860199
   5:     0x7f7bc088fd80 - diagnostic::SpanHandler::span_bug::hbc0c71c406307e37pYE
   6:     0x7f7bc3d2b9e0 - session::Session::span_bug::he2ec64c2aee7f362Dvo
   7:     0x7f7bc4e746d0 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h2143755726639606175
   8:     0x7f7bc4e741e0 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h5005916935757248939
   9:     0x7f7bc4e6d420 - check::upvar::AdjustBorrowKind<'a, 'tcx>::analyze_fn::h825315706994f0e2IQi
  10:     0x7f7bc4ea2840 - check::check_bare_fn::h600d15d87e34ca1bD4k
  11:     0x7f7bc4e9a0d0 - check::check_item::h275b30ae4fb9b22fgnl
  12:     0x7f7bc4f69720 - check_crate::unboxed_closure.31998
  13:     0x7f7bc4f64200 - check_crate::h5aacfae0580e6668NMy
  14:     0x7f7bc6393fe0 - driver::phase_3_run_analysis_passes::h82ada0cbeb74109bVFa
  15:     0x7f7bc637c030 - driver::compile_input::hf24449271908df73Bba
  16:     0x7f7bc643f420 - run_compiler::hd7bb31ad4d130831R8b
  17:     0x7f7bc643db90 - thunk::F.Invoke<A, R>::invoke::h8032505569135520355
  18:     0x7f7bc643caf0 - rt::unwind::try::try_fn::h5190150401514006474
  19:     0x7f7bc5eb9600 - rust_try_inner
  20:     0x7f7bc5eb95f0 - rust_try
  21:     0x7f7bc643cda0 - thunk::F.Invoke<A, R>::invoke::h18133957152747329837
  22:     0x7f7bc5e3ba00 - sys::thread::thread_start::h9000ab048e180f84aPw
  23:     0x7f7bc00b0250 - start_thread
  24:     0x7f7bc5a51219 - clone
  25:                0x0 - <unknown>

Version info:

rustc 1.0.0-nightly (4be79d6ac 2015-01-23 16:08:14 +0000)
binary: rustc
commit-hash: 4be79d6acde9eed3a9b5281a46f385bcb4ce736c
commit-date: 2015-01-23 16:08:14 +0000
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 28, 2015
@huin
Copy link

huin commented Jan 31, 2015

Possibly the same bug:

struct Foo;

pub fn some_func() {
    let f = Foo();
}

Results in:

src/lib.rs:4:13: 4:18 error: expected function, found `Foo`
src/lib.rs:4     let f = Foo();
                         ^~~~~
src/lib.rs:4:13: 4:16 error: internal compiler error: unexpected callee type Foo
src/lib.rs:4     let f = Foo();
                         ^~~
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:129

stack backtrace:
   1:     0x7fc083810850 - sys::backtrace::write::hbd9ef428d64879c0K8t
   2:     0x7fc083833b90 - failure::on_fail::h94da1655857ca583CkB
   3:     0x7fc0837a01d0 - rt::unwind::begin_unwind_inner::h639a1a6cb0c8bc80DZA
   4:     0x7fc080ba5ab0 - rt::unwind::begin_unwind::h6684574056801298421
   5:     0x7fc080ba5a40 - diagnostic::SpanHandler::span_bug::hb9015874fb1e55c8eFE
   6:     0x7fc0816a1ad0 - session::Session::span_bug::h9306d474dc126165IMp
   7:     0x7fc082f61e50 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h709628170010510314
   8:     0x7fc082f61960 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h1927624140920101121
   9:     0x7fc082f5aaa0 - check::upvar::AdjustBorrowKind<'a, 'tcx>::analyze_fn::h1721e1d330f7ab7aqPi
  10:     0x7fc082f8f8a0 - check::check_bare_fn::hdf0cdbfdf545dcaet3k
  11:     0x7fc082f87100 - check::check_item::hdb5c348d01fcd5bb6ll
  12:     0x7fc083056cb0 - check_crate::closure.32034
  13:     0x7fc083051790 - check_crate::hda609b05bfa80f85zNy
  14:     0x7fc083d9be90 - driver::phase_3_run_analysis_passes::h7398ce00da863c69NFa
  15:     0x7fc083d83270 - driver::compile_input::h4dbc958226844635Bba
  16:     0x7fc083e49480 - run_compiler::h6cae23f56147c839n9b
  17:     0x7fc083e47b10 - thunk::F.Invoke<A, R>::invoke::h7959888009317854762
  18:     0x7fc083e46a40 - rt::unwind::try::try_fn::h5318534964293814406
  19:     0x7fc08389ef10 - rust_try_inner
  20:     0x7fc08389ef00 - rust_try
  21:     0x7fc083e46cf0 - thunk::F.Invoke<A, R>::invoke::h10672339334941904280
  22:     0x7fc083820380 - sys::thread::thread_start::h23fd05fc04b5661fQ3w
  23:     0x7fc07da2e0c0 - start_thread
  24:     0x7fc083421fd9 - __clone
  25:                0x0 - <unknown>

Version info:

rustc 1.0.0-nightly (52c74e63d 2015-01-29 22:54:19 +0000)
binary: rustc
commit-hash: 52c74e63dacd49017b19330e0cbecbac0a3fe62e
commit-date: 2015-01-29 22:54:19 +0000
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

@ghost ghost added the E-needs-test Call for participation: Writing correctness tests. label Apr 16, 2015
jooert added a commit to jooert/rust that referenced this issue May 6, 2015
@bors bors closed this as completed in 57a53f0 May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: Writing correctness tests. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants