Skip to content

ICE on use of unboxed closures #17786

@zwarich

Description

@zwarich

The program

#![feature(unboxed_closures, overloaded_calls)]

fn main() {
    let mut v = 0u;
    let p = &mut v;
    let ref f = |&:| { &*p };
    let q = (*f)();
}

causes an ICE:

error: internal compiler error: unexpected failure
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 'assertion failed: self.nodeid_to_index.contains_key(&id)', /Users/mozilla/rust/src/librustc/middle/dataflow.rs:240

stack backtrace:
   1:        0x10b409a79 - rt::backtrace::imp::write::h3c35a4a1c39e4b39xOq
   2:        0x10b40ce1f - failure::on_fail::he90d0d8851524e51b5q
   3:        0x10b6a5b55 - unwind::begin_unwind_inner::ha1a1845acf79fbcePQd
   4:        0x107f8a09c - unwind::begin_unwind::h9834015532924519742
   5:        0x10819d20d - middle::borrowck::build_borrowck_dataflow_data::h6db3d962db9ecd26kGj
   6:        0x108198be4 - middle::borrowck::borrowck_fn::h2f43e23fd34dac9esDj
   7:        0x10819ad24 - visit::walk_expr::h17332693979617847417
   8:        0x10819b2d9 - visit::walk_local::h5546653139216620029
   9:        0x10819b1cc - visit::walk_block::h1241523800298374362
  10:        0x1081990fd - middle::borrowck::borrowck_fn::h2f43e23fd34dac9esDj
  11:        0x10819954e - middle::borrowck::borrowck_item::h5ec3d836d534e004tCj
  12:        0x108199b8c - middle::borrowck::check_crate::hab16c2e0850a9ed8Xvj
  13:        0x107fa8a46 - util::common::time::h15264663546234374381
  14:        0x108871c05 - driver::driver::phase_3_run_analysis_passes::h03a1de560ce9937bvmu
  15:        0x10886bce4 - driver::driver::compile_input::h2d1f323bf62352d187t
  16:        0x1088f903e - driver::run_compiler::h101e7281e7a3b6cdISx
  17:        0x1088f7396 - driver::main_args::closure.148157
  18:        0x107fc186b - task::TaskBuilder<S>::try_future::closure.100184
  19:        0x107fc1763 - task::TaskBuilder<S>::spawn_internal::closure.100155
  20:        0x109407bad - task::spawn_opts::closure.8497
  21:        0x10b70a08c - rust_try_inner
  22:        0x10b70a076 - rust_try
  23:        0x10b6a2eb7 - unwind::try::h4b22e16f00b5af6axFd
  24:        0x10b6a2d2c - task::Task::run::ha1100aac763f3199PVc
  25:        0x109407a02 - task::spawn_opts::closure.8436
  26:        0x10b6a4a0a - thread::thread_start::h45611b574eddc3ba1fd
  27:     0x7fff8bf92899 - _pthread_body
  28:     0x7fff8bf9272a - _pthread_struct_init

Metadata

Metadata

Assignees

No one assigned

    Labels

    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