Skip to content

ICE: In function receiving a boxed Invoke: 'rustc' panicked at 'assertion failed: !ty::type_needs_infer(ty)' #19919

Closed
@Munksgaard

Description

@Munksgaard

The following code results in an internal compiler error:

#![feature(default_type_params)]

use std::thunk::Invoke;

fn foo(x: Box<for <'a>Invoke<&'a int, ()>>) {
}

fn bar() {
    foo( box () (move |: _| () ))
}

fn main() {
}

Compiler output:

$ RUST_BACKTRACE=1 rustc foo.rs
error: internal compiler error: unexpected panic
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 'assertion failed: !ty::type_needs_infer(ty)', /home/munksgaard/src/rust/src/librustc_typeck/
lib.rs:131                                                                                                           

stack backtrace:
   1:     0x7f87b8a7dcf0 - rt::backtrace::imp::write::h645bafd98e8e710ffVx
   2:     0x7f87b8a810c0 - failure::on_fail::hadfa9c4bd89befdeImy
   3:     0x7f87b86c05d0 - unwind::begin_unwind_inner::hb7b66784235a0c45zNc
   4:     0x7f87b7c4e200 - unwind::begin_unwind::h6432056029046382294
   5:     0x7f87b7c77a50 - write_ty_to_tcx::h531c5306c5a4ce51HFy
   6:     0x7f87b7c6f870 - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::he6b1ea82aefc9e13rZb
   7:     0x7f87b7c69180 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h2e5bb818aa1baec7SOb
   8:     0x7f87b7c69180 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h2e5bb818aa1baec7SOb
   9:     0x7f87b7d3cd40 - check::check_bare_fn::h47fbea7c0e66b231Pbk
  10:     0x7f87b7d348d0 - check::check_item::haae896fdd12b9182fvk
  11:     0x7f87b7f8c6d0 - check_crate::unboxed_closure.42749
  12:     0x7f87b7f873e0 - check_crate::h7f1d4273943762142Wy
  13:     0x7f87b8ed0530 - driver::phase_3_run_analysis_passes::h9674b56be39567edEta
  14:     0x7f87b8eb3950 - driver::compile_input::ha2f50471fb032db2rba
  15:     0x7f87b90677f0 - run_compiler::h6ae6cbe07908d3f9AYb
  16:     0x7f87b905e430 - thunk::F.Invoke<A, R>::invoke::h13189201362017435713
  17:     0x7f87b8a560a0 - thunk::F.Invoke<A, R>::invoke::h392198810864924209
  18:     0x7f87b86bed40 - task::Task::spawn_thunk::closure.5776
  19:     0x7f87b871dd20 - rust_try_inner
  20:     0x7f87b871dd10 - rust_try
  21:     0x7f87b86bee50 - unwind::try::h9da252fcf57eda5bQCc
  22:     0x7f87b86bebe0 - task::Task::run::ha8da221d1b1071efRNb
  23:     0x7f87b86be350 - thunk::F.Invoke<A, R>::invoke::h1465999670317872655
  24:     0x7f87b86bfca0 - thread::thread_start::hbb38abc3a96b7cc5b5b
  25:     0x7f87b34c7160 - start_thread
  26:     0x7f87b839dc69 - __clone
  27:                0x0 - <unknown>
$ rustc --version
rustc 0.13.0-dev (126db549b 2014-12-15 00:07:35 +0000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions