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: expected type of closure to be a closure #119025

Closed
matthiaskrgr opened this issue Dec 16, 2023 · 3 comments · Fixed by #117884
Closed

ice: expected type of closure to be a closure #119025

matthiaskrgr opened this issue Dec 16, 2023 · 3 comments · Fixed by #117884
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

pub trait Foo {
    async fn baz() -> i32 {
        || if true { 1 } else { 2 } * 3;
    }
}

original:

// edition:2021

#![allow(incomplete_features)]

pub trait Foo {
    // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32"
    async fn bar() -> i32;

    // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32"
    async fn baz() -> i32 {
    // Test that lambdas behave as unary expressions with block-like expressions
    -if true { 1 } else { 2 } * 3;
    || if true { 1 } else { 2 } * 3;

    //~ ERROR use of undeclared lifetime name `'foo`
    // if true { 1 } else { 2 } * 3
}
}

Version information

rustc 1.76.0-nightly (e223c4102 2023-12-16)
binary: rustc
commit-hash: e223c41028def5123ffd2a4a51a9109b1aae2c2e
commit-date: 2023-12-16
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> /tmp/icemaker_global_tempdir.Jm5p9C7j0cjw/rustc_testrunner_tmpdir_reporting.L3z3qI7ds0DB/mvce.rs:2:5
  |
2 |     async fn baz() -> i32 {
  |     ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: pass `--edition 2021` to `rustc`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.Jm5p9C7j0cjw/rustc_testrunner_tmpdir_reporting.L3z3qI7ds0DB/mvce.rs:5:2
  |
5 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.Jm5p9C7j0cjw/rustc_testrunner_tmpdir_reporting.L3z3qI7ds0DB/mvce.rs`

error[E0308]: mismatched types
 --> /tmp/icemaker_global_tempdir.Jm5p9C7j0cjw/rustc_testrunner_tmpdir_reporting.L3z3qI7ds0DB/mvce.rs:2:27
  |
2 |       async fn baz() -> i32 {
  |  ___________________________^
3 | |         || if true { 1 } else { 2 } * 3;
4 | |     }
  | |_____^ expected `i32`, found `()`

error: internal compiler error: compiler/rustc_mir_build/src/build/mod.rs:654:17: expected type of closure to be a closure

thread 'rustc' panicked at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/compiler/rustc_errors/src/lib.rs:1119:75:
Box<dyn Any>
stack backtrace:
   0:     0x7f2c26b8b10c - std::backtrace_rs::backtrace::libunwind::trace::h40c4f9403e9106ce
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f2c26b8b10c - std::backtrace_rs::backtrace::trace_unsynchronized::h034afacd87380e54
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2c26b8b10c - std::sys_common::backtrace::_print_fmt::h964653ebee1cb7e4
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f2c26b8b10c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h74a6e824a409ebfb
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2c26bde6c0 - core::fmt::rt::Argument::fmt::hfbfcbe20f1de6b4b
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/core/src/fmt/rt.rs:142:9
   5:     0x7f2c26bde6c0 - core::fmt::write::h563ec15019c84174
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f2c26b7efff - std::io::Write::write_fmt::ha8bf6bb3a1d25673
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/io/mod.rs:1810:15
   7:     0x7f2c26b8aef4 - std::sys_common::backtrace::_print::h590ad40e00b03203
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2c26b8aef4 - std::sys_common::backtrace::print::hbde661fab8b9de44
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2c26b8dbf7 - std::panicking::default_hook::{{closure}}::h276d0740e1e4dd9a
  10:     0x7f2c26b8d95f - std::panicking::default_hook::h773a22917e51f7ee
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/panicking.rs:292:9
  11:     0x7f2c2995e5a0 - std[2bf2c5e6f42c1d81]::panicking::update_hook::<alloc[3e1464f82126f796]::boxed::Box<rustc_driver_impl[d5b6de9f3c2a441e]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f2c26b8e338 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h55116213a5c0c206
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/alloc/src/boxed.rs:2029:9
  13:     0x7f2c26b8e338 - std::panicking::rust_panic_with_hook::h67d1cc71ec8072bf
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/panicking.rs:783:13
  14:     0x7f2c29996a84 - std[2bf2c5e6f42c1d81]::panicking::begin_panic::<rustc_errors[5f2b31ed444b107e]::ExplicitBug>::{closure#0}
  15:     0x7f2c29992f16 - std[2bf2c5e6f42c1d81]::sys_common::backtrace::__rust_end_short_backtrace::<std[2bf2c5e6f42c1d81]::panicking::begin_panic<rustc_errors[5f2b31ed444b107e]::ExplicitBug>::{closure#0}, !>
  16:     0x7f2c2998e2a6 - std[2bf2c5e6f42c1d81]::panicking::begin_panic::<rustc_errors[5f2b31ed444b107e]::ExplicitBug>
  17:     0x7f2c299a1d58 - <rustc_errors[5f2b31ed444b107e]::diagnostic_builder::Bug as rustc_errors[5f2b31ed444b107e]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  18:     0x7f2c29d86185 - <rustc_errors[5f2b31ed444b107e]::Handler>::bug::<alloc[3e1464f82126f796]::string::String>
  19:     0x7f2c29e205fd - rustc_middle[2c55df33fbcd02e8]::util::bug::opt_span_bug_fmt::<rustc_span[d66e1cc682400b55]::span_encoding::Span>::{closure#0}
  20:     0x7f2c29e09bea - rustc_middle[2c55df33fbcd02e8]::ty::context::tls::with_opt::<rustc_middle[2c55df33fbcd02e8]::util::bug::opt_span_bug_fmt<rustc_span[d66e1cc682400b55]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f2c29e09a88 - rustc_middle[2c55df33fbcd02e8]::ty::context::tls::with_context_opt::<rustc_middle[2c55df33fbcd02e8]::ty::context::tls::with_opt<rustc_middle[2c55df33fbcd02e8]::util::bug::opt_span_bug_fmt<rustc_span[d66e1cc682400b55]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f2c27d638a0 - rustc_middle[2c55df33fbcd02e8]::util::bug::bug_fmt
  23:     0x7f2c29e7857e - rustc_mir_build[f2854bfd4333bdb3]::build::construct_error
  24:     0x7f2c2aeff52a - rustc_mir_build[f2854bfd4333bdb3]::build::mir_built
  25:     0x7f2c2aefde2d - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  26:     0x7f2c2ae7d503 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::VecCache<rustc_span[d66e1cc682400b55]::def_id::LocalDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  27:     0x7f2c2ae7ce90 - rustc_query_impl[982ae447665c173c]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7f2c280f704e - rustc_mir_transform[216b0e542727acb1]::check_unsafety::unsafety_check_result
  29:     0x7f2c2ae7d287 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  30:     0x7f2c2ae7d503 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::VecCache<rustc_span[d66e1cc682400b55]::def_id::LocalDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  31:     0x7f2c2ae7d010 - rustc_query_impl[982ae447665c173c]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f2c2ae7e4f6 - rustc_mir_transform[216b0e542727acb1]::mir_const
  33:     0x7f2c2ae7e421 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7f2c2ae7d503 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::VecCache<rustc_span[d66e1cc682400b55]::def_id::LocalDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  35:     0x7f2c2ae7cf50 - rustc_query_impl[982ae447665c173c]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f2c28ecd4df - rustc_mir_transform[216b0e542727acb1]::mir_promoted
  37:     0x7f2c2b11e8d2 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 16usize]>>
  38:     0x7f2c2b11eb9c - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::VecCache<rustc_span[d66e1cc682400b55]::def_id::LocalDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  39:     0x7f2c2b11e7d3 - rustc_query_impl[982ae447665c173c]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f2c2ba95a8d - rustc_borrowck[9b01be6d2fbb8954]::mir_borrowck
  41:     0x7f2c2ba959d7 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  42:     0x7f2c2ae7d503 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::VecCache<rustc_span[d66e1cc682400b55]::def_id::LocalDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  43:     0x7f2c2ae7d0d0 - rustc_query_impl[982ae447665c173c]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7f2c2bbe8c71 - <rustc_hir_analysis[70e50c671a2d212]::collect::type_of::opaque::RpitConstraintChecker>::check
  45:     0x7f2c291da565 - <rustc_hir_analysis[70e50c671a2d212]::collect::type_of::opaque::RpitConstraintChecker as rustc_hir[390f8e9e93ef8f24]::intravisit::Visitor>::visit_expr
  46:     0x7f2c2b6bdbe2 - <rustc_hir_analysis[70e50c671a2d212]::collect::type_of::opaque::RpitConstraintChecker as rustc_hir[390f8e9e93ef8f24]::intravisit::Visitor>::visit_block
  47:     0x7f2c2b6bd398 - rustc_hir_analysis[70e50c671a2d212]::collect::type_of::type_of_opaque
  48:     0x7f2c2b6bc973 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  49:     0x7f2c2ac89d14 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::DefaultCache<rustc_span[d66e1cc682400b55]::def_id::DefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  50:     0x7f2c2bc3735e - rustc_query_impl[982ae447665c173c]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  51:     0x7f2c2addaf04 - rustc_middle[2c55df33fbcd02e8]::query::plumbing::query_get_at::<rustc_query_system[6cc3be0e52029f3e]::query::caches::DefaultCache<rustc_span[d66e1cc682400b55]::def_id::DefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>>
  52:     0x7f2c29009b81 - rustc_hir_analysis[70e50c671a2d212]::collect::type_of::type_of
  53:     0x7f2c2ac8aea6 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>
  54:     0x7f2c2ac89d14 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::DefaultCache<rustc_span[d66e1cc682400b55]::def_id::DefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  55:     0x7f2c2ac898db - rustc_query_impl[982ae447665c173c]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  56:     0x7f2c2addaf04 - rustc_middle[2c55df33fbcd02e8]::query::plumbing::query_get_at::<rustc_query_system[6cc3be0e52029f3e]::query::caches::DefaultCache<rustc_span[d66e1cc682400b55]::def_id::DefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 8usize]>>>
  57:     0x7f2c2b8c09c6 - rustc_hir_analysis[70e50c671a2d212]::check::check::check_mod_item_types
  58:     0x7f2c2b8becf3 - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 0usize]>>
  59:     0x7f2c2b7d667b - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::DefaultCache<rustc_span[d66e1cc682400b55]::def_id::LocalModDefId, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  60:     0x7f2c2b7d6057 - rustc_query_impl[982ae447665c173c]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  61:     0x7f2c2b661763 - rustc_hir_analysis[70e50c671a2d212]::check_crate
  62:     0x7f2c2b66a697 - rustc_interface[956eab51901a62c2]::passes::analysis
  63:     0x7f2c2b66a2dd - rustc_query_impl[982ae447665c173c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[982ae447665c173c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 1usize]>>
  64:     0x7f2c2bb79eb2 - rustc_query_system[6cc3be0e52029f3e]::query::plumbing::try_execute_query::<rustc_query_impl[982ae447665c173c]::DynamicConfig<rustc_query_system[6cc3be0e52029f3e]::query::caches::SingleCache<rustc_middle[2c55df33fbcd02e8]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[982ae447665c173c]::plumbing::QueryCtxt, false>
  65:     0x7f2c2bb79cb9 - rustc_query_impl[982ae447665c173c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  66:     0x7f2c2bc2f563 - rustc_interface[956eab51901a62c2]::interface::run_compiler::<core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>, rustc_driver_impl[d5b6de9f3c2a441e]::run_compiler::{closure#0}>::{closure#0}
  67:     0x7f2c2bbac20a - std[2bf2c5e6f42c1d81]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[956eab51901a62c2]::util::run_in_thread_with_globals<rustc_interface[956eab51901a62c2]::util::run_in_thread_pool_with_globals<rustc_interface[956eab51901a62c2]::interface::run_compiler<core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>, rustc_driver_impl[d5b6de9f3c2a441e]::run_compiler::{closure#0}>::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>
  68:     0x7f2c2bbac033 - <<std[2bf2c5e6f42c1d81]::thread::Builder>::spawn_unchecked_<rustc_interface[956eab51901a62c2]::util::run_in_thread_with_globals<rustc_interface[956eab51901a62c2]::util::run_in_thread_pool_with_globals<rustc_interface[956eab51901a62c2]::interface::run_compiler<core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>, rustc_driver_impl[d5b6de9f3c2a441e]::run_compiler::{closure#0}>::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[411d08b4a4626c2f]::result::Result<(), rustc_span[d66e1cc682400b55]::ErrorGuaranteed>>::{closure#1} as core[411d08b4a4626c2f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7f2c26b981c5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdee8ccc00ea3745f
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/alloc/src/boxed.rs:2015:9
  70:     0x7f2c26b981c5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h66e7bd21c6afa306
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/alloc/src/boxed.rs:2015:9
  71:     0x7f2c26b981c5 - std::sys::unix::thread::Thread::new::thread_start::he285325b4cca362f
                               at /rustc/e223c41028def5123ffd2a4a51a9109b1aae2c2e/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7f2c269849eb - <unknown>
  73:     0x7f2c26a087cc - <unknown>
  74:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.76.0-nightly (e223c4102 2023-12-16) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_built] building MIR for `Foo::baz::{closure#0}::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `Foo::baz::{closure#0}::{closure#0}`
#2 [mir_const] preparing `Foo::baz::{closure#0}::{closure#0}` for borrow checking
#3 [mir_promoted] promoting constants in MIR for `Foo::baz::{closure#0}::{closure#0}`
#4 [mir_borrowck] borrow-checking `Foo::baz::{closure#0}::{closure#0}`
#5 [type_of_opaque] computing type of opaque `Foo::baz::{opaque#0}`
#6 [type_of] computing type of `Foo::baz::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0308, E0601, E0670.
For more information about an error, try `rustc --explain E0308`.

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Dec 16, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 16, 2023
@matthiaskrgr
Copy link
Member Author

regression in #117418 ping @compiler-errors

@compiler-errors
Copy link
Member

nice, that's one of the ICE messages I just added too

@matthiaskrgr
Copy link
Member Author

trait Trait {
    fn foo() -> impl Trait {
        || 42
    }
}

@compiler-errors compiler-errors self-assigned this Dec 16, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 16, 2023
@bors bors closed this as completed in d14e52b Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants