Skip to content

ICE: Cannot relate bound region with for and unboxed closures. #19098

Closed
@reem

Description

@reem

ICE:

/Users/reem/code/rust/rust-repro/src/lib.rs:13:20: 13:22 error: internal compiler error: cannot relate bound region: ReLateBound(40, BrNamed(DefId { krate: 0, node: 38 }, 'a)) <= '_#2r
/Users/reem/code/rust/rust-repro/src/lib.rs:13         self.call((st,))
                                                                  ^~
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 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:121

stack backtrace:
   1:        0x10b66c672 - rt::backtrace::imp::write::hbf3dc1e7a4bb0d9fE2s
   2:        0x10b66f81d - failure::on_fail::h19f3f29325059492Fjt
   3:        0x10b8eb8b5 - unwind::begin_unwind_inner::h11f1f10f7191e04ft2c
   4:        0x109603c07 - unwind::begin_unwind::h299357788950154889
   5:        0x109603ba0 - unwind::begin_unwind::h299357788950154889
   6:        0x1088e600a - middle::typeck::infer::region_inference::RegionVarBindings<'a, 'tcx>::make_subregion::h59221b14a213bbc58je
   7:        0x1088f5b9a - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::regions::hcbc885f277691bbakSg
   8:        0x1088f58a1 - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::contraregions::h7b9c530cae6cb51bKRg
   9:        0x10889c4ac - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::tys::h1cd882cb6c9606fb8Zg
  10:        0x10889acee - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::coerce_borrowed_pointer::h60419d2a00735497PU7
  11:        0x10889b34a - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::tys::closure.132651
  12:        0x1088991ba - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::unpack_actual_value::h4042172820200503477
  13:        0x108898fd3 - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::tys::h9098822f957304c3YK7
  14:        0x108903181 - middle::typeck::infer::mk_coercety::closure.134484
  15:        0x108902e7b - middle::typeck::infer::InferCtxt<'a, 'tcx>::commit_if_ok::closure.134476
  16:        0x108902ce2 - middle::typeck::infer::InferCtxt<'a, 'tcx>::commit_unconditionally::h17169791873739487760
  17:        0x1086346df - middle::typeck::infer::mk_coercety::h9fe4bb253c411c79G8j
  18:        0x1087db447 - middle::typeck::check::FnCtxt<'a, 'tcx>::mk_assignty::h5d05f779d9dfa5f0I5Z
  19:        0x1087db285 - middle::typeck::check::demand::coerce::h00e3266736ea9a4fbuT
  20:        0x1088488b9 - middle::typeck::check::check_expr_coercable_to_type::closure.131680
  21:        0x1088460ef - middle::typeck::check::check_expr_with_unifier::h9f8a1b9246334edaoq1
  22:        0x108841e8f - middle::typeck::check::check_expr_with_unifier::h9f8a1b9246334edaoq1
  23:        0x10883eaeb - middle::typeck::check::check_argument_types::hdde5a55181e96ca6ES0
  24:        0x10883b307 - middle::typeck::check::check_method_argument_types::hbe01bcd7c2ac7829PQ0
  25:        0x108843e16 - middle::typeck::check::check_expr_with_unifier::h9f8a1b9246334edaoq1
  26:        0x108805f5f - middle::typeck::check::check_block_with_expected::hfd5adc8884f64ab0IB3
  27:        0x108802ed2 - middle::typeck::check::check_fn::h31448f7d3789f96aZ1X
  28:        0x1088023df - middle::typeck::check::check_bare_fn::h79542489bbb1565eaRX
  29:        0x108808773 - middle::typeck::check::check_method_body::h6674c67abbf753e8jmY
  30:        0x1087ff658 - middle::typeck::check::check_item::h0097c5bb8cb1a848rbY
  31:        0x108802230 - middle::typeck::check::check_item_types::h2eb061d653faf420kQX
  32:        0x10830b986 - util::common::time::h2485648588351033804
  33:        0x108b0b81e - middle::typeck::check_crate::h2980e0b15cfc487a9qr
  34:        0x108b73581 - driver::driver::phase_3_run_analysis_passes::h03ee8ebbed83e7c75gE
  35:        0x108b6d61b - driver::driver::compile_input::h87fe1ab3dfcd86abPXD
  36:        0x108bee225 - driver::run_compiler::h86282bff4e2aa57ckTH
  37:        0x108bec93e - driver::run::closure.144477
  38:        0x10832438b - task::TaskBuilder<S>::try_future::closure.103151
  39:        0x108324283 - task::TaskBuilder<S>::spawn_internal::closure.103122
  40:        0x1082de7bd - task::NativeSpawner.Spawner::spawn::closure.2484
  41:        0x10b94e5ec - rust_try_inner
  42:        0x10b94e5d6 - rust_try
  43:        0x10b8e9057 - unwind::try::h0c66ac3a369bbdae5Qc
  44:        0x10b8e8eec - task::Task::run::h9e20478d3c24ce75S2b
  45:        0x1082de5e3 - task::NativeSpawner.Spawner::spawn::closure.2408
  46:        0x10b8ea727 - thread::thread_start::heb03c58cfc9b7ebfYnc
  47:     0x7fff8a5022fc - _pthread_body
  48:     0x7fff8a502279 - _pthread_body

Reproduce:

pub trait Handler {
    fn handle(&self, &mut String);
}

impl<F> Handler for F
where F: for<'a, 'b> Fn(&'a mut String) {
    fn handle(&self, st: &mut String) {
        self.call((st,))
    }
}

Rustc version:

rustc 0.13.0-nightly (336349c93 2014-11-17 20:37:19 +0000)

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions