Repository: rust
Issue: Internal Compiler Error while building project
Labels: I-ICE,T-compiler,A-incr-comp,C-bug,S-needs-repro

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.

http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/

-->

Please refer to this commit for reproduction: https://github.com/IgnisDa/developrs/tree/418acbcf83d65ecd91cf77408a0175751cd488d2

### Code

```bash
cargo build -p esteem
```


### Meta


`rustc --version --verbose`:
```rustc 1.62.0 (a8314ef7d 2022-06-27)
binary: rustc
commit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc
commit-date: 2022-06-27
host: x86_64-unknown-linux-gnu
release: 1.62.0
LLVM version: 14.0.5
```

### Error output

<details><summary><strong>Error output</strong></summary>
<p>


```txt
vscode@f956bec04ece /workspace (main)> rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.62.0 (a8314ef7d 2022-06-27)

vscode@f956bec04ece /workspace (main)> cargo build -p esteem
   Compiling esteem v1.0.0 (/workspace/packages/esteem)
warning: unused variable: `project_name`
   --> packages/esteem/src/cli.rs:192:31
    |
192 | pub fn utils_get_dependencies(project_name: String) {
    |                               ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_project_name`
    |
    = note: `#[warn(unused_variables)]` on by default

thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:517:36
stack backtrace:
   0:     0x7f7176ecbfed - std::backtrace_rs::backtrace::libunwind::trace::hb729d9642bb971eb
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f7176ecbfed - std::backtrace_rs::backtrace::trace_unsynchronized::h373bb774579df5c7
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7176ecbfed - std::sys_common::backtrace::_print_fmt::hfbd4e92d240c89bb
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f7176ecbfed - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8f618991fbf64972
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f7176f27c7c - core::fmt::write::hc69b5b640d88cce8
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/fmt/mod.rs:1196:17
   5:     0x7f7176ebd6c1 - std::io::Write::write_fmt::h3403cef06a24a303
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/io/mod.rs:1654:15
   6:     0x7f7176eced05 - std::sys_common::backtrace::_print::h368f27cdedea0e52
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f7176eced05 - std::sys_common::backtrace::print::ha105c9cf5a64cd17
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f7176eced05 - std::panicking::default_hook::{{closure}}::h48ed2c3707d5e20e
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:295:22
   9:     0x7f7176ece979 - std::panicking::default_hook::h8744fc5cea5e3110
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:314:9
  10:     0x7f7177693961 - rustc_driver[cc15f272104f8c81]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f71669e26b3 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h5ffde454a69fcb3e
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/alloc/src/boxed.rs:1886:9
  12:     0x7f7166a102ed - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h419e4872c9776274
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/proc_macro/src/bridge/client.rs:335:21
  13:     0x7f7176ecf4d6 - std::panicking::rust_panic_with_hook::hc82286af2030e925
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:702:17
  14:     0x7f7176ecf2d7 - std::panicking::begin_panic_handler::{{closure}}::h1c15057c2f09081f
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:588:13
  15:     0x7f7176ecc4a4 - std::sys_common::backtrace::__rust_end_short_backtrace::h65de906a5330f8da
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:138:18
  16:     0x7f7176ecf009 - rust_begin_unwind
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
  17:     0x7f7176e94283 - core::panicking::panic_fmt::h741cfbfc95bc6112
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
  18:     0x7f7178adee0f - rustc_mir_transform[34692f6d13108f5a]::check_unsafety::unsafety_check_result
  19:     0x7f7178ad61b0 - <rustc_mir_transform[34692f6d13108f5a]::check_unsafety::provide::{closure#0} as core[6724bec812d80be0]::ops::function::FnOnce<(rustc_middle[2b9dbf3985a9058b]::ty::context::TyCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId)>>::call_once
  20:     0x7f7177f714ab - <rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind as rustc_query_system[a16ac1cefdea5f76]::dep_graph::DepKind>::with_deps::<rustc_query_system[a16ac1cefdea5f76]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>
  21:     0x7f7179c9abd0 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>
  22:     0x7f717915e686 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::try_execute_query::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_query_system[a16ac1cefdea5f76]::query::caches::DefaultCache<rustc_span[aeddd698d19619f]::def_id::LocalDefId, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>>
  23:     0x7f7179127d7e - <rustc_query_impl[37d320545ae1f097]::Queries as rustc_middle[2b9dbf3985a9058b]::ty::query::QueryEngine>::unsafety_check_result
  24:     0x7f7178ae1efa - rustc_mir_transform[34692f6d13108f5a]::check_unsafety::unsafety_check_result
  25:     0x7f7178ad61b0 - <rustc_mir_transform[34692f6d13108f5a]::check_unsafety::provide::{closure#0} as core[6724bec812d80be0]::ops::function::FnOnce<(rustc_middle[2b9dbf3985a9058b]::ty::context::TyCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId)>>::call_once
  26:     0x7f7179bc11c0 - <rustc_query_system[a16ac1cefdea5f76]::dep_graph::graph::DepGraph<rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[2b9dbf3985a9058b]::ty::context::TyCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>
  27:     0x7f717915e7a6 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::try_execute_query::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_query_system[a16ac1cefdea5f76]::query::caches::DefaultCache<rustc_span[aeddd698d19619f]::def_id::LocalDefId, &rustc_middle[2b9dbf3985a9058b]::mir::query::UnsafetyCheckResult>>
  28:     0x7f7179c27f46 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::force_query::<rustc_query_impl[37d320545ae1f097]::queries::unsafety_check_result, rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt>
  29:     0x7f7179c1d94e - rustc_query_impl[37d320545ae1f097]::query_callbacks::unsafety_check_result::force_from_dep_node
  30:     0x7f71795b1401 - <rustc_middle[2b9dbf3985a9058b]::ty::context::TyCtxt as rustc_query_system[a16ac1cefdea5f76]::dep_graph::DepContext>::try_force_from_dep_node
  31:     0x7f71790ee9ce - <rustc_query_system[a16ac1cefdea5f76]::dep_graph::graph::DepGraph<rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt>
  32:     0x7f71790ee99c - <rustc_query_system[a16ac1cefdea5f76]::dep_graph::graph::DepGraph<rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt>
  33:     0x7f71790ee99c - <rustc_query_system[a16ac1cefdea5f76]::dep_graph::graph::DepGraph<rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt>
  34:     0x7f717913c935 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::ensure_must_run::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_span[aeddd698d19619f]::def_id::LocalDefId, ()>
  35:     0x7f7179128392 - <rustc_query_impl[37d320545ae1f097]::Queries as rustc_middle[2b9dbf3985a9058b]::ty::query::QueryEngine>::mir_borrowck
  36:     0x7f717897b6e4 - <rustc_middle[2b9dbf3985a9058b]::hir::map::Map>::par_body_owners::<rustc_interface[a10bc87377f6ea4]::passes::analysis::{closure#2}::{closure#0}>
  37:     0x7f7179733c28 - <rustc_session[834eb9541c60901f]::session::Session>::time::<(), rustc_interface[a10bc87377f6ea4]::passes::analysis::{closure#2}>
  38:     0x7f717972e515 - rustc_interface[a10bc87377f6ea4]::passes::analysis
  39:     0x7f7179bd93b5 - <rustc_query_system[a16ac1cefdea5f76]::dep_graph::graph::DepGraph<rustc_middle[2b9dbf3985a9058b]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[2b9dbf3985a9058b]::ty::context::TyCtxt, (), core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>
  40:     0x7f7179c7eca1 - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::try_execute_query::<rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt, rustc_query_system[a16ac1cefdea5f76]::query::caches::DefaultCache<(), core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>>
  41:     0x7f7179cbffbe - rustc_query_system[a16ac1cefdea5f76]::query::plumbing::get_query::<rustc_query_impl[37d320545ae1f097]::queries::analysis, rustc_query_impl[37d320545ae1f097]::plumbing::QueryCtxt>
  42:     0x7f717970ef97 - <rustc_interface[a10bc87377f6ea4]::passes::QueryContext>::enter::<rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>
  43:     0x7f71796f9fe8 - <rustc_interface[a10bc87377f6ea4]::interface::Compiler>::enter::<rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}::{closure#2}, core[6724bec812d80be0]::result::Result<core[6724bec812d80be0]::option::Option<rustc_interface[a10bc87377f6ea4]::queries::Linker>, rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>
  44:     0x7f71797226ef - rustc_span[aeddd698d19619f]::with_source_map::<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_interface[a10bc87377f6ea4]::interface::create_compiler_and_run<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}>::{closure#1}>
  45:     0x7f717970e024 - rustc_interface[a10bc87377f6ea4]::interface::create_compiler_and_run::<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}>
  46:     0x7f71796f84f2 - <scoped_tls[7f4edc8f5e37700f]::ScopedKey<rustc_span[aeddd698d19619f]::SessionGlobals>>::set::<rustc_interface[a10bc87377f6ea4]::interface::run_compiler<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}>::{closure#0}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>
  47:     0x7f717970f61f - std[62a6aef941a414a5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a10bc87377f6ea4]::util::run_in_thread_pool_with_globals<rustc_interface[a10bc87377f6ea4]::interface::run_compiler<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}>::{closure#0}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>::{closure#0}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>
  48:     0x7f717970f759 - <<std[62a6aef941a414a5]::thread::Builder>::spawn_unchecked_<rustc_interface[a10bc87377f6ea4]::util::run_in_thread_pool_with_globals<rustc_interface[a10bc87377f6ea4]::interface::run_compiler<core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>, rustc_driver[cc15f272104f8c81]::run_compiler::{closure#1}>::{closure#0}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>::{closure#0}, core[6724bec812d80be0]::result::Result<(), rustc_errors[7cc8b2502942d635]::ErrorGuaranteed>>::{closure#1} as core[6724bec812d80be0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7f7176ed93f3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcbca3baf872b7fe4
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/alloc/src/boxed.rs:1872:9
  50:     0x7f7176ed93f3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h18790338ce1743e2
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/alloc/src/boxed.rs:1872:9
  51:     0x7f7176ed93f3 - std::sys::unix::thread::Thread::new::thread_start::hb1067183bad48893
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7f7176e04ea7 - start_thread
  53:     0x7f7176d27def - clone
  54:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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: rustc 1.62.0 (a8314ef7d 2022-06-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `workspace::<impl at packages/esteem/src/workspace.rs:38:1: 117:2>::get_dependencies_to_remove::{closure#1}`
#1 [unsafety_check_result] unsafety-checking `workspace::<impl at packages/esteem/src/workspace.rs:38:1: 117:2>::get_dependencies_to_remove`
#2 [analysis] running analysis passes on this crate
end of query stack
warning: `esteem` (lib) generated 1 warning
error: could not compile `esteem`; 1 warning emitted
```

</p>
</details>

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
   Compiling esteem v1.0.0 (/workspace/packages/esteem)
warning: unused variable: `project_name`
   --> packages/esteem/src/cli.rs:192:31
    |
192 | pub fn utils_get_dependencies(project_name: String) {
    |                               ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_project_name`
    |
    = note: `#[warn(unused_variables)]` on by default

thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:517:36
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
   2: rustc_mir_transform::check_unsafety::unsafety_check_result
   3: <rustc_mir_transform::check_unsafety::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
   4: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle::mir::query::UnsafetyCheckResult>
   5: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>
   6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>>
   7: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::unsafety_check_result
   8: rustc_mir_transform::check_unsafety::unsafety_check_result
   9: <rustc_mir_transform::check_unsafety::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
  10: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>
  11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>>
  12: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::unsafety_check_result, rustc_query_impl::plumbing::QueryCtxt>
  13: rustc_query_impl::query_callbacks::unsafety_check_result::force_from_dep_node
  14: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
  15: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  17: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  18: rustc_query_system::query::plumbing::ensure_must_run::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, ()>
  19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  20: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_interface::passes::analysis::{closure#2}::{closure#0}>
  21: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
  22: rustc_interface::passes::analysis
  23: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  24: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  25: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  26: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  27: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  28: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  29: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  30: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: 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: rustc 1.62.0 (a8314ef7d 2022-06-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `workspace::<impl at packages/esteem/src/workspace.rs:38:1: 117:2>::get_dependencies_to_remove::{closure#1}`
#1 [unsafety_check_result] unsafety-checking `workspace::<impl at packages/esteem/src/workspace.rs:38:1: 117:2>::get_dependencies_to_remove`
#2 [analysis] running analysis passes on this crate
end of query stack
warning: `esteem` (lib) generated 1 warning
error: could not compile `esteem`; 1 warning emitted
```

</p>
</details>


### Additional details

This error does not occur on this nightly version:

```
rustc 1.64.0-nightly (9a7b7d5e5 2022-07-19)
binary: rustc
commit-hash: 9a7b7d5e50ab0b59c6d349bbf005680a7c880e98
commit-date: 2022-07-19
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6
```