Skip to content

ICE with generic types used in unboxed closures parameters #18245

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

Closed
juanevp opened this issue Oct 22, 2014 · 2 comments
Closed

ICE with generic types used in unboxed closures parameters #18245

juanevp opened this issue Oct 22, 2014 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@juanevp
Copy link

juanevp commented Oct 22, 2014

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).

@bkoropoff
Copy link
Contributor

This is the same as #16791

@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 24, 2014
@alexcrichton
Copy link
Member

Thanks @bkoropoff!

lnicola pushed a commit to lnicola/rust that referenced this issue Oct 17, 2024
…Veykril

lsp: fix completion_item something_to_resolve not being a latch to true

while looking at rust-lang#18245 i noticed that `something_to_resolve` could technically flap between true -> false if some subsequent fields that were requested to be resolved were empty.

this fixes that by using `|=` instead of `=` when assigning to `something_to_resolve` which will prevent it from going back to false once set.

although some cases it's simply assigning to `true` i opted to continue to use `|=` there for uniformity sake. but happy to change those back to `=`'s.

cc `@SomeoneToIgnore`
lnicola pushed a commit to lnicola/rust that referenced this issue Oct 17, 2024
fix: include description in label details when detail field is marked for …

Fixes rust-lang/rust-analyzer#18231.

When omitting the autocomplete detail field, the autocomplete label details can still be returned. Currently the label details are missing the description field if the detail field is included in resolveSupport since it is being overwritten as None and opted to be sent with `completionItem/resolve`.

Example completion capabilities.
```
completion = {
    completionItem = {
        commitCharactersSupport = true,
        deprecatedSupport = true,
        documentationFormat = { "markdown", "plaintext" },
        insertReplaceSupport = true,
        insertTextModeSupport = {
            valueSet = { 1, 2 }
        },
        labelDetailsSupport = true,
        preselectSupport = true,
        resolveSupport = {
            properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" }
        },
        snippetSupport = true,
        tagSupport = {
            valueSet = { 1 }
        }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants