Skip to content

ICE with generic types used in unboxed closures parameters #18245

Closed
@juanevp

Description

@juanevp

This program:

#![feature(unboxed_closures)]

fn test_generic_closure<T>() {
    |&: i: T| { i };
}

fn main() {
    test_generic_closure::<f64>();
}

Generates the following compiler error:

error: internal compiler error: fictitious type T in sizing_type_of()
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>', C:\bot\slave\nightly-win-64\build\src\libsyntax\diagnostic.rs:175

stack backtrace:
   1:         0x66be4310 - ZN2rt9backtrace3imp5write20h1af28aac487341e6mJqE
   2:         0x66be7dec - ZN2rt4init20h4292e4f337cb4f72SWqE
   3:         0x6684645d - ZN6unwind18begin_unwind_inner20he2c50d697996cb4bIhdE
   4:         0x6a65b476 - ZN10diagnostic11SpanHandler8span_bug20hcf49d10121e28ba85MFE
   5:         0x6a65bb47 - ZN10diagnostic7Handler3bug20h2c61476274631793sTFE
   6:         0x6d6ae172 - ZN6middle5trans7type_of14sizing_type_of20h3b8f153d961f1465ITbE
   7:         0x6d6bc5a9 - ZN6middle5trans6common17type_is_immediate20h767aefdaac2ea0fcRX7E
   8:         0x6d718552 - ZN6middle5trans7type_of15type_of_rust_fn20h3942ff09083b7064jQbE
   9:         0x6d729d48 - ZN6middle5trans4base12decl_rust_fn20h33eb26c4e7502725p6eE
  10:         0x6d6c702a - ZN6middle5trans7closure44get_or_create_declaration_if_unboxed_closure20h720adfab4c6c27992jlE
  11:         0x6d6eb997 - ZN6middle5trans7closure21trans_unboxed_closure20h108e495e5872b2582olE
  12:         0x6d6d791e - ZN6middle2ty9expr_kind20hdcb1519bfc5936e6eXIE
  13:         0x6d69b754 - ZN6middle5trans4expr10trans_into20h74b874e970b63496BI4E
  14:         0x6d69aaf0 - ZN6middle5trans11controlflow15trans_stmt_semi20h14131d2507b60563YX0E
  15:         0x6d69a1e6 - ZN6middle5trans11controlflow10trans_stmt20h4c5820c94c0ed41dLT0E
  16:         0x6d69b999 - ZN6middle5trans11controlflow11trans_block20hc30a9db5bc195bfbRY0E
  17:         0x6d73d4bd - ZN6middle5trans4base13trans_closure20hc822458bc81f6eecV4gE
  18:         0x6d68e60d - ZN6middle5trans4base8trans_fn20h0f9efc426cef329djghE
  19:         0x6d690146 - ZN6middle5trans12monomorphize14monomorphic_fn20h4f2a2f3545691110hp0E
  20:         0x6d6c2849 - ZN6middle5trans6callee24trans_fn_ref_with_substs20h9d6d288d38d466b2GC3E
  21:         0x6d6bf94e - ZN6middle5trans6callee12trans_fn_ref20h5d5100ba29bebeb3wq3E
  22:         0x6d6c845b - ZN6middle5trans6common9expr_info20h0dd6791bad6c95e6917E
  23:         0x6d6a2c1e - ZN6middle5trans6callee16trans_call_inner20hb94881301875c484qY3E
  24:         0x6d6c7b60 - ZN6middle5trans6callee10trans_call20h08e5127712cad695KS3E
  25:         0x6d6d807b - ZN6middle2ty9expr_kind20hdcb1519bfc5936e6eXIE
  26:         0x6d69b754 - ZN6middle5trans4expr10trans_into20h74b874e970b63496BI4E
  27:         0x6d69aaf0 - ZN6middle5trans11controlflow15trans_stmt_semi20h14131d2507b60563YX0E
  28:         0x6d69a1e6 - ZN6middle5trans11controlflow10trans_stmt20h4c5820c94c0ed41dLT0E
  29:         0x6d69b999 - ZN6middle5trans11controlflow11trans_block20hc30a9db5bc195bfbRY0E
  30:         0x6d73d4bd - ZN6middle5trans4base13trans_closure20hc822458bc81f6eecV4gE
  31:         0x6d68e60d - ZN6middle5trans4base8trans_fn20h0f9efc426cef329djghE
  32:         0x6d68bd21 - ZN6middle5trans4base10trans_item20h1a263fca5ac72c6eCzhE
  33:         0x6d746759 - ZN6middle5trans4base11trans_crate20h2a360d6b723578d5txiE
  34:         0x6db8b129 - ZN6driver6driver25phase_4_translate_to_llvm20hf081d732e26e6e1dxyAE
  35:         0x6db83716 - ZN6driver6driver13compile_input20h71f4f576d289d94dr5zE
  36:         0x6dc08145 - ZN6driver7monitor20h93f4ed24069c156eGGEE
  37:         0x6dc06470 - ZN6driver7monitor20h93f4ed24069c156eGGEE
  38:         0x6d33d895 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20hd8dbffdebebfd4a0VUAE
  39:         0x6d33d7c7 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20hd8dbffdebebfd4a0VUAE
  40:         0x7072b2dc - ZN4task15Ops.rt..Runtime4wrap20h14c929059cf1137bVxeE
  41:         0x668aac5f - rust_try
  42:         0x668aac39 - rust_try
  43:         0x6684440e - ZN6unwind3try20ha56f382774aa0b03M4cE
  44:         0x66844249 - ZN4task4Task3run20hc767dd9e98fe66e7czcE
  45:         0x7072b116 - ZN4task15Ops.rt..Runtime4wrap20h14c929059cf1137bVxeE
  46:         0x66845a27 - ZN4task11BlockedTask14cast_from_uint20h9f694ac57d66c528PRcE
  47:     0x7ffa366816ad - BaseThreadInitThunk

The compiler used is rustc 0.13.0-nightly (3d2cf60 2014-10-22 00:22:04 +0000) (window x64).

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