rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.02k stars 12.68k forks source link

ICE: `can't find an upper bound` in nll::compute_regions in rustc_borrowck #122704

Open shkoo opened 7 months ago

shkoo commented 7 months ago

Code

use std::any::Any;

pub struct Foo {
    bar: Box<dyn for<'a> Fn(&'a usize) -> Box<dyn Any + 'a>>,
}

impl Foo {
    pub fn ack<I>(&mut self, f: impl for<'a> Fn(&'a usize) -> Box<I>) {
        self.bar = Box::new(|baz| Box::new(f(baz)));
    }
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.79.0-nightly (eb45c8444 2024-03-17)
binary: rustc
commit-hash: eb45c844407968ea54df0d9870ebce9e3235b706
commit-date: 2024-03-17
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.2

Error output

thread 'rustc' panicked at compiler/rustc_borrowck/src/type_check/free_region_relations.rs:97:9:
can't find an upper bound!?
stack backtrace:
   0:     0x7fcf37ef030f - std::backtrace_rs::backtrace::libunwind::trace::hd1b8e7bf69bd2659
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7fcf37ef030f - std::backtrace_rs::backtrace::trace_unsynchronized::ha2541878f17a8bf5
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fcf37ef030f - std::backtrace::Backtrace::create::h2489761f8d713f8d
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/backtrace.rs:331:13
   3:     0x7fcf37ef0250 - std::backtrace::Backtrace::force_capture::h212b9648ae6a4e34
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/backtrace.rs:312:9
   4:     0x7fcf3af33762 - std[f30794364a8567e8]::panicking::update_hook::<alloc[d4fc0c1400399e53]::boxed::Box<rustc_driver_impl[977aa2f7506c0463]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7fcf37f0ab50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::he9235fc142cfefbc
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/alloc/src/boxed.rs:2034:9
   6:     0x7fcf37f0ab50 - std::panicking::rust_panic_with_hook::hcb10f10b9294465e
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/panicking.rs:783:13
   7:     0x7fcf37f0a859 - std::panicking::begin_panic_handler::{{closure}}::h1df158136e631df7
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/panicking.rs:649:13
   8:     0x7fcf37f07de6 - std::sys_common::backtrace::__rust_end_short_backtrace::h3eabad15a30d1baa
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7fcf37f0a5c4 - rust_begin_unwind
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/panicking.rs:645:5
  10:     0x7fcf37f551a5 - core::panicking::panic_fmt::hc408b30751ce7310
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/core/src/panicking.rs:72:14
  11:     0x7fcf3ad4253d - <rustc_borrowck[19dbd917483b2da6]::type_check::free_region_relations::UniversalRegionRelations>::non_local_upper_bounds
  12:     0x7fcf39a48644 - rustc_borrowck[19dbd917483b2da6]::nll::compute_regions
  13:     0x7fcf3d1605ef - rustc_borrowck[19dbd917483b2da6]::do_mir_borrowck
  14:     0x7fcf3c349228 - rustc_borrowck[19dbd917483b2da6]::mir_borrowck
  15:     0x7fcf3c348d17 - rustc_query_impl[29f35dd1a1f5675d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[29f35dd1a1f5675d]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 8usize]>>
  16:     0x7fcf3c34ad2e - rustc_query_system[7e5eced594b3b3e4]::query::plumbing::try_execute_query::<rustc_query_impl[29f35dd1a1f5675d]::DynamicConfig<rustc_query_system[7e5eced594b3b3e4]::query::caches::VecCache<rustc_span[30575adc3f012a9d]::def_id::LocalDefId, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[29f35dd1a1f5675d]::plumbing::QueryCtxt, false>
  17:     0x7fcf3c34a84c - rustc_query_impl[29f35dd1a1f5675d]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  18:     0x7fcf3cc5d29c - rustc_middle[e264bbe93e45f6ca]::query::plumbing::query_get_at::<rustc_query_system[7e5eced594b3b3e4]::query::caches::VecCache<rustc_span[30575adc3f012a9d]::def_id::LocalDefId, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 8usize]>>>
  19:     0x7fcf3cc5d30e - <rustc_borrowck[19dbd917483b2da6]::type_check::TypeChecker>::prove_closure_bounds
  20:     0x7fcf3c6873a3 - <rustc_borrowck[19dbd917483b2da6]::type_check::TypeChecker>::typeck_mir
  21:     0x7fcf39a024ea - rustc_borrowck[19dbd917483b2da6]::type_check::type_check
  22:     0x7fcf39a3c137 - rustc_borrowck[19dbd917483b2da6]::nll::compute_regions
  23:     0x7fcf3d1605ef - rustc_borrowck[19dbd917483b2da6]::do_mir_borrowck
  24:     0x7fcf3c349228 - rustc_borrowck[19dbd917483b2da6]::mir_borrowck
  25:     0x7fcf3c348d17 - rustc_query_impl[29f35dd1a1f5675d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[29f35dd1a1f5675d]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 8usize]>>
  26:     0x7fcf3c34ad2e - rustc_query_system[7e5eced594b3b3e4]::query::plumbing::try_execute_query::<rustc_query_impl[29f35dd1a1f5675d]::DynamicConfig<rustc_query_system[7e5eced594b3b3e4]::query::caches::VecCache<rustc_span[30575adc3f012a9d]::def_id::LocalDefId, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[29f35dd1a1f5675d]::plumbing::QueryCtxt, false>
  27:     0x7fcf3c34a84c - rustc_query_impl[29f35dd1a1f5675d]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fcf3c61d95d - rustc_interface[2a44f2ea1a7c30d3]::passes::analysis
  29:     0x7fcf3c61cb19 - rustc_query_impl[29f35dd1a1f5675d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[29f35dd1a1f5675d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 1usize]>>
  30:     0x7fcf3cfc7ec3 - rustc_query_system[7e5eced594b3b3e4]::query::plumbing::try_execute_query::<rustc_query_impl[29f35dd1a1f5675d]::DynamicConfig<rustc_query_system[7e5eced594b3b3e4]::query::caches::SingleCache<rustc_middle[e264bbe93e45f6ca]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[29f35dd1a1f5675d]::plumbing::QueryCtxt, false>
  31:     0x7fcf3cfc7c3f - rustc_query_impl[29f35dd1a1f5675d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7fcf3cdf3084 - rustc_interface[2a44f2ea1a7c30d3]::interface::run_compiler::<core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>, rustc_driver_impl[977aa2f7506c0463]::run_compiler::{closure#0}>::{closure#0}
  33:     0x7fcf3cedf685 - std[f30794364a8567e8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2a44f2ea1a7c30d3]::util::run_in_thread_with_globals<rustc_interface[2a44f2ea1a7c30d3]::util::run_in_thread_pool_with_globals<rustc_interface[2a44f2ea1a7c30d3]::interface::run_compiler<core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>, rustc_driver_impl[977aa2f7506c0463]::run_compiler::{closure#0}>::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>
  34:     0x7fcf3cedf4b2 - <<std[f30794364a8567e8]::thread::Builder>::spawn_unchecked_<rustc_interface[2a44f2ea1a7c30d3]::util::run_in_thread_with_globals<rustc_interface[2a44f2ea1a7c30d3]::util::run_in_thread_pool_with_globals<rustc_interface[2a44f2ea1a7c30d3]::interface::run_compiler<core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>, rustc_driver_impl[977aa2f7506c0463]::run_compiler::{closure#0}>::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[451cccbd72d71aca]::result::Result<(), rustc_span[30575adc3f012a9d]::ErrorGuaranteed>>::{closure#1} as core[451cccbd72d71aca]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7fcf37f141e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h746ad893ba25d760
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/alloc/src/boxed.rs:2020:9
  36:     0x7fcf37f141e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6b3d742dc2cb92e7
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/alloc/src/boxed.rs:2020:9
  37:     0x7fcf37f141e5 - std::sys::pal::unix::thread::Thread::new::thread_start::h23f93afbf81ba466
                               at /rustc/eb45c844407968ea54df0d9870ebce9e3235b706/library/std/src/sys/pal/unix/thread.rs:108:17
  38:     0x7fcf37e14609 - start_thread
                               at /build/glibc-wuryBv/glibc-2.31/nptl/pthread_create.c:477:8
  39:     0x7fcf37d39353 - clone
                               at /build/glibc-wuryBv/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  40:                0x0 - <unknown>

rustc version: 1.79.0-nightly (eb45c8444 2024-03-17)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at repro.rs:7:1: 7:9>::ack::{closure#0}`
#1 [mir_borrowck] borrow-checking `<impl at repro.rs:7:1: 7:9>::ack`
#2 [analysis] running analysis passes on this crate
end of query stack
matthiaskrgr commented 7 months ago

Regression in nightly-2022-06-08 get_commits_between returning commits, len: 7 commit[0] 2022-06-06: Auto merge of #97730 - flip1995:clippyup, r=Manishearth commit[1] 2022-06-06: Auto merge of #97809 - matthiaskrgr:rollup-ajyvjd3, r=matthiaskrgr commit[2] 2022-06-07: Auto merge of #97801 - RalfJung:miri, r=RalfJung commit[3] 2022-06-07: Auto merge of #95565 - jackh726:remove-borrowck-mode, r=nikomatsakis commit[4] 2022-06-07: Auto merge of #97512 - scottmcm:add-coldcc, r=nagisa,lcnr commit[5] 2022-06-07: Auto merge of #97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPC commit[6] 2022-06-07: Auto merge of #97835 - Dylan-DPC:rollup-0ae3pwp, r=Dylan-DPC ERROR: no CI builds available between 50b00252aeb77b10db04d65dc9e12ce758def4b5 and 5435ed6916a59e8d5acba2149316a841c3905cbd within last 167 days

probably 95565 ? cc @jackh726

lqd commented 7 months ago

That PR removed NLL's migrate mode, so maybe the bisection could go further back with with #![feature(nll)], to opt-in to full NLLs before it was the default.

matthiaskrgr commented 7 months ago

fourth attempt or so... searched toolchains nightly-2018-01-01 through nightly-2024-03-18

Regression in nightly-2019-03-14

looking for regression commit between 2019-03-13 and 2019-03-14 fetching (via remote github) commits from max(7c19e1eed5418b8c02be65d678417b241ee01a3e, 2019-03-11) to 719b0d9849dab698c1ff0630313d068c7d561eae ending github query because we found starting sha: 7c19e1eed5418b8c02be65d678417b241ee01a3e get_commits_between returning commits, len: 6 commit[0] 2019-03-12: Auto merge of #58015 - icefoxen:tryfrom-docs, r=SimonSapin commit[1] 2019-03-12: Auto merge of #58743 - varkor:bulk-needstest-1, r=alexcrichton commit[2] 2019-03-13: Auto merge of #59151 - Centril:rollup, r=Centril commit[3] 2019-03-13: Auto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoerister commit[4] 2019-03-13: Auto merge of #58349 - petrochenkov:uni201x, r=pnkfelix commit[5] 2019-03-13: Auto merge of #59143 - ehuss:update-cargo, r=ehuss ERROR: no CI builds available between 7c19e1eed5418b8c02be65d678417b241ee01a3e and 719b0d9849dab698c1ff0630313d068c7d561eae within last 167 days

maybe https://github.com/rust-lang/rust/pull/59132/ ?

theemathas commented 4 months ago

Minimized:

trait IsStatic: 'static {}

impl<T: 'static> IsStatic for T {}

fn foo<T>(x: Box<T>) -> Box<dyn for<'a> FnOnce(&'a ()) -> Box<dyn IsStatic + 'a>> {
    Box::new(move |_| x)
}
Error output ``` Compiling playground v0.0.1 (/playground) thread 'rustc' panicked at compiler/rustc_borrowck/src/type_check/free_region_relations.rs:97:9: can't find an upper bound!? stack backtrace: 0: 0x7fa39f960ae5 - std::backtrace_rs::backtrace::libunwind::trace::hd03f93528d46491d at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: 0x7fa39f960ae5 - std::backtrace_rs::backtrace::trace_unsynchronized::h74dc0b19b052c2ae at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7fa39f960ae5 - std::sys_common::backtrace::_print_fmt::h9a3bc0e652cf7b69 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys_common/backtrace.rs:68:5 3: 0x7fa39f960ae5 - ::fmt::h4837d7bdd071c26e at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7fa39f9b177b - core::fmt::rt::Argument::fmt::h5f4cca7a86de3ac3 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/core/src/fmt/rt.rs:165:63 5: 0x7fa39f9b177b - core::fmt::write::h58fee7e5e6f828bb at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/core/src/fmt/mod.rs:1168:21 6: 0x7fa39f9556bf - std::io::Write::write_fmt::h5a54d56832f12d0f at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/io/mod.rs:1835:15 7: 0x7fa39f9608be - std::sys_common::backtrace::_print::hf8a2cb55c2c8353b at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys_common/backtrace.rs:47:5 8: 0x7fa39f9608be - std::sys_common::backtrace::print::h6b23178d2042c60b at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys_common/backtrace.rs:34:9 9: 0x7fa39f9632f9 - std::panicking::default_hook::{{closure}}::h8098cbc85e732f3b 10: 0x7fa39f96309c - std::panicking::default_hook::h21b51f336018bc80 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/panicking.rs:292:9 11: 0x7fa3a2c957ff - std[e439e5cd3a449d52]::panicking::update_hook::>::{closure#0} 12: 0x7fa39f963bff - as core::ops::function::Fn>::call::h5602e10eecbd0618 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/alloc/src/boxed.rs:2076:9 13: 0x7fa39f963bff - std::panicking::rust_panic_with_hook::hd1b3711c6ea634e2 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/panicking.rs:801:13 14: 0x7fa39f9637f3 - std::panicking::begin_panic_handler::{{closure}}::h01c1581833053b47 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/panicking.rs:660:13 15: 0x7fa39f960fa9 - std::sys_common::backtrace::__rust_end_short_backtrace::h12d87452272215f0 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys_common/backtrace.rs:171:18 16: 0x7fa39f9634d4 - rust_begin_unwind at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/panicking.rs:658:5 17: 0x7fa39f9add33 - core::panicking::panic_fmt::h219f5a3f16bd9a4d at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/core/src/panicking.rs:74:14 18: 0x7fa3a2aa270a - ::non_local_upper_bounds 19: 0x7fa3a115387d - rustc_borrowck[d08da6903e11d7f3]::nll::compute_regions 20: 0x7fa3a4f5f93a - rustc_borrowck[d08da6903e11d7f3]::do_mir_borrowck 21: 0x7fa3a4f51a3e - rustc_query_impl[8f9eb950d6cc008f]::plumbing::__rust_begin_short_backtrace::> 22: 0x7fa3a42e66ee - rustc_query_system[8ccdec27dd679281]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[8f9eb950d6cc008f]::plumbing::QueryCtxt, false> 23: 0x7fa3a42e614d - rustc_query_impl[8f9eb950d6cc008f]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace 24: 0x7fa3a4930860 - rustc_middle[e07a585f38de947]::query::plumbing::query_get_at::>> 25: 0x7fa3a49308ce - ::prove_closure_bounds 26: 0x7fa3a40e459e - ::typeck_mir 27: 0x7fa3a11845ad - rustc_borrowck[d08da6903e11d7f3]::type_check::type_check 28: 0x7fa3a1147ca8 - rustc_borrowck[d08da6903e11d7f3]::nll::compute_regions 29: 0x7fa3a4f5f93a - rustc_borrowck[d08da6903e11d7f3]::do_mir_borrowck 30: 0x7fa3a4f51a3e - rustc_query_impl[8f9eb950d6cc008f]::plumbing::__rust_begin_short_backtrace::> 31: 0x7fa3a42e66ee - rustc_query_system[8ccdec27dd679281]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[8f9eb950d6cc008f]::plumbing::QueryCtxt, false> 32: 0x7fa3a42e614d - rustc_query_impl[8f9eb950d6cc008f]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace 33: 0x7fa3a4a0b313 - rustc_interface[c905b19a64c8fe9a]::passes::analysis 34: 0x7fa3a4a0a487 - rustc_query_impl[8f9eb950d6cc008f]::plumbing::__rust_begin_short_backtrace::> 35: 0x7fa3a4df92a5 - rustc_query_system[8ccdec27dd679281]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[8f9eb950d6cc008f]::plumbing::QueryCtxt, false> 36: 0x7fa3a4df900f - rustc_query_impl[8f9eb950d6cc008f]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace 37: 0x7fa3a4cbd7d2 - rustc_interface[c905b19a64c8fe9a]::interface::run_compiler::, rustc_driver_impl[9892696329624aa2]::run_compiler::{closure#0}>::{closure#1} 38: 0x7fa3a4ce13a7 - std[e439e5cd3a449d52]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[9892696329624aa2]::run_compiler::{closure#0}>::{closure#1}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>>::{closure#0}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>> 39: 0x7fa3a4ce116a - <::spawn_unchecked_, rustc_driver_impl[9892696329624aa2]::run_compiler::{closure#0}>::{closure#1}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>>::{closure#0}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bd37ed12c97f867b]::result::Result<(), rustc_span[7d8a0f37f02bb30e]::ErrorGuaranteed>>::{closure#2} as core[bd37ed12c97f867b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 40: 0x7fa39f96da7b - as core::ops::function::FnOnce>::call_once::h32b9a9f0c1b7e30b at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/alloc/src/boxed.rs:2062:9 41: 0x7fa39f96da7b - as core::ops::function::FnOnce>::call_once::h33379ef2bcdd46d5 at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/alloc/src/boxed.rs:2062:9 42: 0x7fa39f96da7b - std::sys::pal::unix::thread::Thread::new::thread_start::h27a5de020b7d499b at /rustc/f8e566053207b4ecbcbc7a7d6ded82c43061e3da/library/std/src/sys/pal/unix/thread.rs:108:17 43: 0x7fa39f87b609 - start_thread 44: 0x7fa39f79e353 - clone 45: 0x0 - 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 make sure that you have updated to the latest nightly note: please attach the file at `/playground/rustc-ice-2024-06-15T05_47_22-27.txt` to your bug report note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [mir_borrowck] borrow-checking `foo::{closure#0}` #1 [mir_borrowck] borrow-checking `foo` end of query stack error: could not compile `playground` (lib) ```

Identical to #125891 except for having dyn instead of impl.