Skip to content

ICE on generic type inference failure for unboxed closures #17551

Closed
@pythonesque

Description

@pythonesque
#![feature(unboxed_closures)]

struct Foo<T>;

fn main() {
    let foo = Foo;
    let closure = |:| foo;
}

$ RUST_BACKTRACE=1 rustc src/testcase.rs
src/testcase.rs:6:9: 6:18 error: cannot determine a type for this local variable: unconstrained type [E0102]
src/testcase.rs:6     let foo = Foo;
                          ^~~~~~~~~
error: internal compiler error: node_id_to_type: no type for node `local foo (id=15)`
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/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:169

stack backtrace:
   1:     0x7f7b95332f00 - rt::backtrace::imp::write::hb40e767174eadc9blLq
   2:     0x7f7b953360c0 - failure::on_fail::hab6209505fea7a58N6q
   3:     0x7f7b99a29f80 - unwind::begin_unwind_inner::h3a7e8417aad82c7eMTd
   4:     0x7f7b960e0450 - unwind::begin_unwind::h2392538768877619269
   5:     0x7f7b960e0bc0 - diagnostic::Handler::bug::hbcf500f6b0a7b557wjF
   6:     0x7f7b9a07c780 - driver::session::Session::bug::h0f635b08aa66c6feeQx
   7:     0x7f7b9a2908a0 - middle::ty::node_id_to_type::hd1dd1c474c094922f8F
   8:     0x7f7b9a4ccc90 - middle::ty::unboxed_closure_upvars::h66608a955acb136dB7H
   9:     0x7f7b9a568860 - middle::ty::type_contents::tc_ty::hb84a0da980526fb7ycF
  10:     0x7f7b9a2ffc90 - middle::ty::type_contents::ha411939ce3d142aetbF
  11:     0x7f7b9a4082a0 - middle::traits::fulfill::FulfillmentContext::check_builtin_bound_obligations::h5b19f19377505db3yUV
  12:     0x7f7b9a5991f0 - middle::typeck::check::vtable2::check_builtin_bound_obligations::h11d059c52111579fDiL
  13:     0x7f7b9a5ec6a0 - middle::typeck::check::check_bare_fn::h854b4341f0f8841bpsS
  14:     0x7f7b9a5e6620 - middle::typeck::check::check_item::he10ec73ffea798b14ZS
  15:     0x7f7b9a5ebf40 - middle::typeck::check::check_item_types::h757d0292ac6a701dnrS
  16:     0x7f7b9a0927d0 - util::common::time::h7040980569714169789
  17:     0x7f7b9a895250 - middle::typeck::check_crate::h3c78e9fb1a6da400cDk
  18:     0x7f7b9a8fec10 - driver::driver::phase_3_run_analysis_passes::h01e80bc9274a9fc096w
  19:     0x7f7b9a8f9f50 - driver::driver::compile_input::h644c4bcdb8d4fa416Nw
  20:     0x7f7b9a97be40 - driver::run_compiler::hd9154f69e0f25652kFA
  21:     0x7f7b9a97bd20 - driver::main_args::closure.146572
  22:     0x7f7b9a0abe70 - task::TaskBuilder<S>::try_future::closure.101814
  23:     0x7f7b9a0abc60 - task::TaskBuilder<S>::spawn_internal::closure.101785
  24:     0x7f7b99d79540 - task::spawn_opts::closure.8457
  25:     0x7f7b99a80390 - rust_try_inner
  26:     0x7f7b99a80380 - rust_try
  27:     0x7f7b99a27580 - unwind::try::haa9a6e4d3a3bf10cuId
  28:     0x7f7b99a273e0 - task::Task::run::h18e39631c20de002cYc
  29:     0x7f7b99d792b0 - task::spawn_opts::closure.8397
  30:     0x7f7b99a28fd0 - thread::thread_start::hfdbefd9910b77f41rid
  31:     0x7f7b946db250 - start_thread
  32:     0x7f7b997013b9 - clone
  33:                0x0 - <unknown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions