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 with nested impl and closure capture #117802

Closed
jruderman opened this issue Nov 11, 2023 · 2 comments
Closed

ICE with nested impl and closure capture #117802

jruderman opened this issue Nov 11, 2023 · 2 comments
Labels
A-closures Area: Closures (`|…| { … }`) 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

@jruderman
Copy link
Contributor

Found with a modified fuzz-rustc

Code

trait T {}

fn f() -> impl Fn(impl T) {
    let p = ();
    |_| p
}

fn main() {}

The ICE occurs with --edition=2021 but not with --edition=2018

Error output

error[E0666]: nested impl Trait is not allowed

error[E0562]: impl Trait only allowed in function and inherent method argument and return types, not in Fn trait params

thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:253:31:
called Option::unwrap() on a None value

Full output including backtrace
error[E0666]: nested `impl Trait` is not allowed
 --> src/main.rs:3:19
  |
3 | fn f() -> impl Fn(impl T) {
  |           --------^^^^^^-
  |           |       |
  |           |       nested `impl Trait` here
  |           outer `impl Trait`

error[E0562]: `impl Trait` only allowed in function and inherent method argument and return types, not in `Fn` trait params
 --> src/main.rs:3:19
  |
3 | fn f() -> impl Fn(impl T) {
  |                   ^^^^^^

thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:253:31:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x101ba629b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47b89dfc1056a325
   1:        0x101c01f03 - core::fmt::write::h5d68fbe2da19f28b
   2:        0x101b9c6ae - std::io::Write::write_fmt::h88f43327f33ae491
   3:        0x101ba6079 - std::sys_common::backtrace::print::h5e901b20eaadd8d9
   4:        0x101ba9245 - std::panicking::default_hook::{{closure}}::h8c7a1b1f76e41deb
   5:        0x101ba8fc4 - std::panicking::default_hook::haa88fb66995109d3
   6:        0x1118d27ae - <alloc[586afbd608b72962]::boxed::Box<rustc_driver_impl[e6cc4300320f3020]::install_ice_hook::{closure#0}> as core[bc4f2b6eb0b2df1c]::ops::function::Fn<(&dyn for<'a, 'b> core[bc4f2b6eb0b2df1c]::ops::function::Fn<(&'a core[bc4f2b6eb0b2df1c]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[bc4f2b6eb0b2df1c]::marker::Send + core[bc4f2b6eb0b2df1c]::marker::Sync, &core[bc4f2b6eb0b2df1c]::panic::panic_info::PanicInfo)>>::call
   7:        0x101ba98e5 - std::panicking::rust_panic_with_hook::h1d8fecf8796034a5
   8:        0x101ba964c - std::panicking::begin_panic_handler::{{closure}}::hb6fd7b02e92de3d2
   9:        0x101ba6779 - std::sys_common::backtrace::__rust_end_short_backtrace::hc0896fbb75ca2467
  10:        0x101ba93d2 - _rust_begin_unwind
  11:        0x101c2bb85 - core::panicking::panic_fmt::hbf1cd1e15e487a46
  12:        0x101c2bc17 - core::panicking::panic::ha5648d053fcea7cf
  13:        0x1125ca0f0 - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest
  14:        0x1125ccc78 - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::in_scope::<<rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest::{closure#0}::{closure#0}, ()>
  15:        0x1125ca82d - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest::{closure#0}
  16:        0x1125c7656 - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest
  17:        0x1125ccc78 - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::in_scope::<<rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest::{closure#0}::{closure#0}, ()>
  18:        0x1125ca82d - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest::{closure#0}
  19:        0x1125c7656 - <rustc_mir_build[27120349ba8a14dd]::build::Builder>::expr_into_dest
  20:        0x1125a3c09 - rustc_mir_build[27120349ba8a14dd]::build::mir_build::{closure#0}
  21:        0x1125a22e3 - rustc_mir_build[27120349ba8a14dd]::build::mir_built
  22:        0x112d5392f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  23:        0x112eab90c - <rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_built::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  24:        0x112d0241f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  25:        0x112d90ccb - rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  26:        0x1127496ca - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  27:        0x112765e70 - rustc_mir_transform[7673fa52c4d14ac1]::check_unsafety::unsafety_check_result
  28:        0x112d5156f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  29:        0x112ea94fc - <rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  30:        0x112d0241f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  31:        0x112d990ab - rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  32:        0x1127496ca - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  33:        0x1127642a6 - <rustc_mir_transform[7673fa52c4d14ac1]::check_unsafety::UnsafetyChecker as rustc_middle[64d5e69fdab215c5]::mir::visit::Visitor>::visit_rvalue
  34:        0x112766120 - rustc_mir_transform[7673fa52c4d14ac1]::check_unsafety::unsafety_check_result
  35:        0x112d5156f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  36:        0x112ea94fc - <rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  37:        0x112d0241f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  38:        0x112d990ab - rustc_query_impl[1f7dbace0c76e519]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  39:        0x1128d456d - rustc_mir_transform[7673fa52c4d14ac1]::mir_const
  40:        0x112d5394f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  41:        0x112e664cc - <rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_const::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  42:        0x112d0241f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  43:        0x112d90fbb - rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  44:        0x1128bf65a - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  45:        0x1128d4acf - rustc_mir_transform[7673fa52c4d14ac1]::mir_promoted
  46:        0x112d4e2c4 - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 16usize]>>
  47:        0x112e62a90 - <rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_promoted::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  48:        0x112cf446a - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  49:        0x112d91c5b - rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  50:        0x1111c64d3 - rustc_borrowck[80340335ac9afbc1]::mir_borrowck
  51:        0x112d4e26f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  52:        0x112e626ac - <rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalDefId)>>::call_once
  53:        0x112d0241f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  54:        0x112d9d39b - rustc_query_impl[1f7dbace0c76e519]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  55:        0x111be239a - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::VecCache<rustc_span[5ac116ba370720eb]::def_id::LocalDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  56:        0x111bf7331 - rustc_hir_analysis[cebd03adaf2a8c68]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  57:        0x112d4ecd4 - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  58:        0x112f3bfbf - <rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of_opaque::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::DefId)>>::call_once
  59:        0x112ca0f7f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::DefaultCache<rustc_span[5ac116ba370720eb]::def_id::DefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  60:        0x112d8c74a - rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  61:        0x111bbfd37 - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::DefaultCache<rustc_span[5ac116ba370720eb]::def_id::DefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  62:        0x111bd6593 - rustc_hir_analysis[cebd03adaf2a8c68]::collect::type_of::type_of
  63:        0x112d535b1 - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>
  64:        0x112f4269f - <rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::DefId)>>::call_once
  65:        0x112ca0f7f - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::DefaultCache<rustc_span[5ac116ba370720eb]::def_id::DefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  66:        0x112d8c42a - rustc_query_impl[1f7dbace0c76e519]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  67:        0x111bbfd37 - rustc_middle[64d5e69fdab215c5]::query::plumbing::query_get_at::<rustc_query_system[a9a8fa527be5a562]::query::caches::DefaultCache<rustc_span[5ac116ba370720eb]::def_id::DefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 8usize]>>>
  68:        0x111bc6604 - rustc_hir_analysis[cebd03adaf2a8c68]::check::check::check_item_type
  69:        0x111bceafc - rustc_hir_analysis[cebd03adaf2a8c68]::check::check::check_mod_item_types
  70:        0x112d50e2f - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 0usize]>>
  71:        0x112f3e86c - <rustc_query_impl[1f7dbace0c76e519]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, rustc_span[5ac116ba370720eb]::def_id::LocalModDefId)>>::call_once
  72:        0x112c82040 - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::DefaultCache<rustc_span[5ac116ba370720eb]::def_id::LocalModDefId, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  73:        0x112d9b09a - rustc_query_impl[1f7dbace0c76e519]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  74:        0x111c1c0fe - rustc_hir_analysis[cebd03adaf2a8c68]::check_crate
  75:        0x1120d386f - rustc_interface[33ae589e04b46ee6]::passes::analysis
  76:        0x112d535cd - rustc_query_impl[1f7dbace0c76e519]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1f7dbace0c76e519]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 1usize]>>
  77:        0x112f13559 - <rustc_query_impl[1f7dbace0c76e519]::query_impl::analysis::dynamic_query::{closure#2} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<(rustc_middle[64d5e69fdab215c5]::ty::context::TyCtxt, ())>>::call_once
  78:        0x112c39ba0 - rustc_query_system[a9a8fa527be5a562]::query::plumbing::try_execute_query::<rustc_query_impl[1f7dbace0c76e519]::DynamicConfig<rustc_query_system[a9a8fa527be5a562]::query::caches::SingleCache<rustc_middle[64d5e69fdab215c5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1f7dbace0c76e519]::plumbing::QueryCtxt, false>
  79:        0x112d8d601 - rustc_query_impl[1f7dbace0c76e519]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  80:        0x1118d6dc1 - <rustc_middle[64d5e69fdab215c5]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>
  81:        0x111879ccd - <rustc_interface[33ae589e04b46ee6]::interface::Compiler>::enter::<rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}::{closure#2}, core[bc4f2b6eb0b2df1c]::result::Result<core[bc4f2b6eb0b2df1c]::option::Option<rustc_interface[33ae589e04b46ee6]::queries::Linker>, rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>
  82:        0x1118ae400 - rustc_span[5ac116ba370720eb]::set_source_map::<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_interface[33ae589e04b46ee6]::interface::run_compiler<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  83:        0x1118b0110 - rustc_span[5ac116ba370720eb]::create_session_globals_then::<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_interface[33ae589e04b46ee6]::util::run_in_thread_pool_with_globals<rustc_interface[33ae589e04b46ee6]::interface::run_compiler<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}>::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#0}>
  84:        0x1118ec635 - std[32cc99a1e09f1cb9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[33ae589e04b46ee6]::util::run_in_thread_with_globals<rustc_interface[33ae589e04b46ee6]::util::run_in_thread_pool_with_globals<rustc_interface[33ae589e04b46ee6]::interface::run_compiler<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}>::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>
  85:        0x1118f11e9 - <<std[32cc99a1e09f1cb9]::thread::Builder>::spawn_unchecked_<rustc_interface[33ae589e04b46ee6]::util::run_in_thread_with_globals<rustc_interface[33ae589e04b46ee6]::util::run_in_thread_pool_with_globals<rustc_interface[33ae589e04b46ee6]::interface::run_compiler<core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>, rustc_driver_impl[e6cc4300320f3020]::run_compiler::{closure#1}>::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bc4f2b6eb0b2df1c]::result::Result<(), rustc_span[5ac116ba370720eb]::ErrorGuaranteed>>::{closure#1} as core[bc4f2b6eb0b2df1c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  86:        0x101bb3a99 - std::sys::unix::thread::Thread::new::thread_start::h3e0c38234bb5890f
  87:     0x7ff81e7c04e1 - __pthread_start

error: the compiler unexpectedly panicked. this is a bug.

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: please attach the file at `/Users/jruderman/code/tt/b1/rustc-ice-2023-11-11T02_04_53-7516.txt` to your bug report

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

Some errors have detailed explanations: E0562, E0666.
For more information about an error, try `rustc --explain E0562`.

Regression

Regression in nightly-2022-01-15, possibly due to #89861

Commits in range
  commit[0] 2022-01-13UTC: Auto merge of #89861 - nbdd0121:closure, r=wesleywiser
  commit[1] 2022-01-14UTC: Auto merge of #92844 - matthiaskrgr:rollup-z5wb6yi, r=matthiaskrgr
  commit[2] 2022-01-14UTC: Auto merge of #92781 - lambinoo:I-92755-no-mir-missing-reachable, r=petrochenkov
  commit[3] 2022-01-14UTC: Auto merge of #92681 - Aaron1011:task-deps-ref, r=cjgillot
  commit[4] 2022-01-14UTC: Auto merge of #92883 - matthiaskrgr:rollup-uoudywx, r=matthiaskrgr

Version

rustc 1.75.0-nightly (fdaaaf9f9 2023-11-08)
binary: rustc
commit-hash: fdaaaf9f923281ab98b865259aa40fbf93d72c7a
commit-date: 2023-11-08
host: x86_64-apple-darwin
release: 1.75.0-nightly
LLVM version: 17.0.4
@jruderman jruderman added 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. labels Nov 11, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 11, 2023
@saethlin saethlin added A-closures Area: Closures (`|…| { … }`) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 11, 2023
@matthiaskrgr
Copy link
Member

I think this is a duplicate of #110453

@matthiaskrgr
Copy link
Member

Fixed by #118751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) 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

No branches or pull requests

4 participants