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

ICE: When moving Fn bound to where clause #16549

Closed
japaric opened this issue Aug 17, 2014 · 0 comments · Fixed by #16616
Closed

ICE: When moving Fn bound to where clause #16549

japaric opened this issue Aug 17, 2014 · 0 comments · Fixed by #16616
Labels
A-closures Area: Closures (`|…| { … }`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@japaric
Copy link
Member

japaric commented Aug 17, 2014

STR

#![feature(unboxed_closures)]

struct Bencher;

// ICE
fn warm_up<'a, F>(f: F)
    where F: |&: &'a mut Bencher|
{
    unimplemented!();
}

// OK
//fn warm_up<'a, F: |&: &'a mut Bencher|>(f: F) { unimplemented!() }

fn main() {
    // ICE trigger
    warm_up(|&: b: &mut Bencher| unimplemented!() );

    // OK
    warm_up(|&: b| unimplemented!() );
}

Backtrace

ice.rs:17:5: 17:12 error: internal compiler error: cannot relate bound region: ReLateBound(7, BrNamed(syntax::ast::DefId{krate: 0u32, node: 14u32}, 'a)) <= ReInfer(8)
ice.rs:17     warm_up(|&: b: &mut Bencher| unimplemented!() );
              ^~~~~~~
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>', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/ast_util.rs:791

stack backtrace:
   1:     0x7f7d7ee16ec0 - rt::backtrace::imp::write::h0d672ecc305d940eAxr
   2:     0x7f7d7ee19f90 - <unknown>
   3:     0x7f7d7f5f0c80 - unwind::begin_unwind_inner::had82a5715f0c70a6Zhe
   4:     0x7f7d7b500150 - <unknown>
   5:     0x7f7d7b5000a0 - diagnostic::SpanHandler::span_bug::h5311365fdefe54613uF
   6:     0x7f7d7fba1610 - driver::session::Session::span_bug::hdc7a4659699633a7bOA
   7:     0x7f7d8007a7c0 - middle::typeck::infer::region_inference::RegionVarBindings<'a>::make_subregion::heb4b085f2458b2f3lX5
   8:     0x7f7d800609f0 - middle::typeck::infer::sub::Sub<'f>.Combine::regions::h2742a65556179ddajs8
   9:     0x7f7d80060d60 - middle::typeck::infer::sub::Sub<'f>.Combine::contraregions::h661a459f8cc4d8c0Jr8
  10:     0x7f7d8004a710 - middle::typeck::infer::sub::Sub<'f>.Combine::tys::he592ec9eb9d995dfJA8
  11:     0x7f7d8008f850 - <unknown>
  12:     0x7f7d80060f70 - <unknown>
  13:     0x7f7d8004a710 - middle::typeck::infer::sub::Sub<'f>.Combine::tys::he592ec9eb9d995dfJA8
  14:     0x7f7d8008f150 - <unknown>
  15:     0x7f7d80047d60 - <unknown>
  16:     0x7f7d8008efd0 - <unknown>
  17:     0x7f7d8008d3a0 - <unknown>
  18:     0x7f7d800b9e70 - <unknown>
  19:     0x7f7d800b9ba0 - <unknown>
  20:     0x7f7d800b99f0 - <unknown>
  21:     0x7f7d7ff3d0a0 - middle::typeck::infer::mk_sub_trait_refs::h215f9c26284f866anxd
  22:     0x7f7d7ff3ca10 - <unknown>
  23:     0x7f7d7ff3dd40 - <unknown>
  24:     0x7f7d7ff3ae60 - <unknown>
  25:     0x7f7d7fefff00 - middle::ty::each_bound_trait_and_supertraits::h1becbefbed517889NOI
  26:     0x7f7d7ff3a8e0 - <unknown>
  27:     0x7f7d7ff38720 - <unknown>
  28:     0x7f7d7ff48340 - <unknown>
  29:     0x7f7d7ff481b0 - middle::typeck::check::FnCtxt<'a>::opt_node_ty_substs::hf2958efb0b7310b21XU
  30:     0x7f7d7ff44660 - middle::typeck::check::vtable::early_resolve_expr::hac1019c39f97238axnM
  31:     0x7f7d7ff4b960 - <unknown>
  32:     0x7f7d7ff4d2f0 - middle::typeck::check::vtable::resolve_in_block::ha70b06cbd736c562H7M
  33:     0x7f7d7ffa9e60 - <unknown>
  34:     0x7f7d7ffa2fd0 - middle::typeck::check::check_item::hd430fed06beea5592BT
  35:     0x7f7d7ffa9c60 - middle::typeck::check::check_item_types::h06acd5dca8e5d103b2S
  36:     0x7f7d7f9c3330 - <unknown>
  37:     0x7f7d801b8210 - middle::typeck::check_crate::hcdc2f87496d7d542HFk
  38:     0x7f7d802854f0 - driver::driver::phase_3_run_analysis_passes::haa0c1431e392c3b2Vfz
  39:     0x7f7d80280630 - driver::driver::compile_input::h0a11de02699c1d9111y
  40:     0x7f7d8032d4b0 - <unknown>
  41:     0x7f7d8032d3c0 - <unknown>
  42:     0x7f7d8033fdf0 - <unknown>
  43:     0x7f7d8033fbf0 - <unknown>
  44:     0x7f7d80d8e840 - <unknown>
  45:     0x7f7d7f640990 - <unknown>
  46:     0x7f7d7f640980 - rust_try
  47:     0x7f7d7f5ee2e0 - unwind::try::hbae38345f951cdabf6d
  48:     0x7f7d7f5ee080 - task::Task::run::hfc294062f8a07e89xcd
  49:     0x7f7d80d8e600 - <unknown>
  50:     0x7f7d7f5efec0 - <unknown>
  51:     0x7f7d7e8a7000 - start_thread
  52:     0x7f7d7f2bf269 - clone
  53:                0x0 - <unknown>

Version

rustc 0.12.0-pre (78ec3904b 2014-08-16 13:01:09 +0000)

cc @pcwalton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants