Repository: rust
Issue: internal compiler error: cannot relate bound regon
Labels: I-ICE,T-compiler,C-bug

<!--
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/
-->

### Code

```Rust
use std::{thread, time};
use cursive::backend::Backend;
use cursive::views::Canvas;
use cursive::*;
use cursive::event::Key;

mod sprite;
use sprite::AnimationGroup;
use sprite::{Sprite, Animation};

mod gameobject;
use gameobject::*;

fn main() {
    let mut tick:usize = 0;             // tick incriments on refresh
    let mut siv = Cursive::default();   // load cursive and set global theme 
    siv.load_toml(include_str!("theme.toml")).unwrap();
    siv.set_global_callback(Key::Backspace, |s| s.quit()); // quit on backspace 

   //cursive backend
    let back_end = backends::try_default().unwrap();
    let mut runner = CursiveRunner::new(siv, back_end);
    
    //original code, Animation loads 
    //a series of images in dir
    let anim = Action{
        animation:Animation::new("./path/to/dir".to_owned(), 32)
    };  
    
    // canvas that draws ascii image to terminal
    let canvas = Canvas::new( (&anim, tick)).with_draw(
        | data:(&Action, &usize), printer:&Printer | {
            printer.print_styled(
                XY::new(32, 32),
                // Action::view(action tick) -> SpannedString
                Action::view(data.0, data.1.clone()));
        }
    );
    // add canvas layer to cursive obj
    siv.add_layer(canvas);
        
    //global refresh 1/16s
    let refresh_rate = time::Duration::from_millis(125);
    let mut now = time::Instant::now();
    //main loop
    while runner.is_running()
    {
        if now.elapsed().as_millis() > refresh_rate.as_millis(){
            tick += 1;
            now = time::Instant::now();
            runner.step();
            runner.refresh();
        }else{}
    }
}
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-unknown-linux-gnu
release: 1.68.2
LLVM version: 15.0.6
```

### Error output

```
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:114 ~ cli_game[8b65]::main::'_), '_) }) <= '_#17r

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:     0x7f2b04d6659a - std::backtrace_rs::backtrace::libunwind::trace::ha271a8a7e1f3d4ef
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f2b04d6659a - std::backtrace_rs::backtrace::trace_unsynchronized::h85739da0352c791a
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2b04d6659a - std::sys_common::backtrace::_print_fmt::hbc6ebcfb2910b329
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f2b04d6659a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he1c117e52d53614f
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2b04dc839e - core::fmt::write::h25eb51b9526b8e0c
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/fmt/mod.rs:1213:17
   5:     0x7f2b04d56be5 - std::io::Write::write_fmt::ha9edec5fb1621933
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/io/mod.rs:1682:15
   6:     0x7f2b04d66365 - std::sys_common::backtrace::_print::hf8657cd429fc3452
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f2b04d66365 - std::sys_common::backtrace::print::h41b9b18ed86f86bd
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f2b04d6912f - std::panicking::default_hook::{{closure}}::h22a91871f4454152
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:267:22
   9:     0x7f2b04d68e6b - std::panicking::default_hook::h21ddc36de0cd4ae7
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:286:9
  10:     0x7f2b080b9324 - rustc_driver[70f63b52fde826b7]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f2b04d6996a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6f7e3c94ecc52e2f
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:2002:9
  12:     0x7f2b04d6996a - std::panicking::rust_panic_with_hook::h5059419d6d59b3d0
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:692:13
  13:     0x7f2b08374f81 - std[f8b79e573431a86c]::panicking::begin_panic::<rustc_errors[53e74ce803854a4d]::ExplicitBug>::{closure#0}
  14:     0x7f2b0836d8d6 - std[f8b79e573431a86c]::sys_common::backtrace::__rust_end_short_backtrace::<std[f8b79e573431a86c]::panicking::begin_panic<rustc_errors[53e74ce803854a4d]::ExplicitBug>::{closure#0}, !>
  15:     0x7f2b083fdda6 - std[f8b79e573431a86c]::panicking::begin_panic::<rustc_errors[53e74ce803854a4d]::ExplicitBug>
  16:     0x7f2b083fdd96 - std[f8b79e573431a86c]::panic::panic_any::<rustc_errors[53e74ce803854a4d]::ExplicitBug>
  17:     0x7f2b083fc6c2 - <rustc_errors[53e74ce803854a4d]::HandlerInner>::span_bug::<rustc_span[7c23fb27ec020b97]::span_encoding::Span, &alloc[b346c7f99e9347e5]::string::String>
  18:     0x7f2b083fc567 - <rustc_errors[53e74ce803854a4d]::Handler>::span_bug::<rustc_span[7c23fb27ec020b97]::span_encoding::Span, &alloc[b346c7f99e9347e5]::string::String>
  19:     0x7f2b083b1acb - rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}
  20:     0x7f2b083b1b1a - rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_opt::<rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f2b083b0bda - rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_context_opt::<rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_opt<rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f2b083b0b06 - rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>
  23:     0x7f2b083b0ac4 - rustc_middle[6dfce017f6b7786d]::util::bug::span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>
  24:     0x7f2b06044604 - <rustc_middle[6dfce017f6b7786d]::ty::sty::Region as rustc_middle[6dfce017f6b7786d]::ty::relate::Relate>::relate::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  25:     0x7f2b0603ef86 - rustc_middle[6dfce017f6b7786d]::ty::relate::super_relate_tys::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  26:     0x7f2b0603c8be - <rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate as rustc_middle[6dfce017f6b7786d]::ty::relate::TypeRelation>::tys
  27:     0x7f2b0603f6e6 - rustc_middle[6dfce017f6b7786d]::ty::relate::super_relate_tys::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  28:     0x7f2b0603c8be - <rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate as rustc_middle[6dfce017f6b7786d]::ty::relate::TypeRelation>::tys
  29:     0x7f2b068cedb3 - <rustc_infer[83c7bda8c7ffae41]::infer::InferCtxt>::commit_if_ok::<rustc_infer[83c7bda8c7ffae41]::infer::InferOk<()>, rustc_middle[6dfce017f6b7786d]::ty::error::TypeError, <rustc_infer[83c7bda8c7ffae41]::infer::at::Trace>::eq<rustc_middle[6dfce017f6b7786d]::ty::Ty>::{closure#0}>
  30:     0x7f2b068ceca6 - <rustc_infer[83c7bda8c7ffae41]::infer::at::At>::eq::<rustc_middle[6dfce017f6b7786d]::ty::Ty>
  31:     0x7f2b08c9739e - <rustc_infer[83c7bda8c7ffae41]::infer::InferCtxt>::can_eq::<rustc_middle[6dfce017f6b7786d]::ty::Ty>
  32:     0x7f2b08c7a1d2 - rustc_trait_selection[d385e741675330b5]::traits::error_reporting::suggestions::hint_missing_borrow
  33:     0x7f2b08d1d934 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  34:     0x7f2b08d2d788 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  35:     0x7f2b08d37167 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  36:     0x7f2b08d2a7cf - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  37:     0x7f2b062b5b93 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::demand_coerce
  38:     0x7f2b0627e689 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_decl
  39:     0x7f2b0627b773 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_block_with_expected
  40:     0x7f2b06245d3c - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7f2b061e08d1 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_return_expr
  42:     0x7f2b061d7802 - rustc_hir_typeck[698e9809084ff9ec]::check::check_fn
  43:     0x7f2b061c00be - rustc_hir_typeck[698e9809084ff9ec]::typeck
  44:     0x7f2b061b1797 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, rustc_span[7c23fb27ec020b97]::def_id::LocalDefId, &rustc_middle[6dfce017f6b7786d]::ty::typeck_results::TypeckResults>
  45:     0x7f2b061a92eb - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::typeck, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  46:     0x7f2b078163cd - rustc_data_structures[560608da72c35763]::sync::par_for_each_in::<&[rustc_span[7c23fb27ec020b97]::def_id::LocalDefId], <rustc_middle[6dfce017f6b7786d]::hir::map::Map>::par_body_owners<rustc_hir_typeck[698e9809084ff9ec]::typeck_item_bodies::{closure#0}>::{closure#0}>
  47:     0x7f2b07816173 - rustc_hir_typeck[698e9809084ff9ec]::typeck_item_bodies
  48:     0x7f2b078301d7 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, (), ()>
  49:     0x7f2b07639c26 - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::typeck_item_bodies, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  50:     0x7f2b07a71d5b - <rustc_query_impl[81153385010d7886]::Queries as rustc_middle[6dfce017f6b7786d]::ty::query::QueryEngine>::typeck_item_bodies
  51:     0x7f2b0654eee2 - <rustc_session[cd7c78827427c6d6]::session::Session>::time::<(), rustc_hir_analysis[651175ae4d1746c1]::check_crate::{closure#7}>
  52:     0x7f2b0654e352 - rustc_hir_analysis[651175ae4d1746c1]::check_crate
  53:     0x7f2b0654dfab - rustc_interface[698bad460dbd68d3]::passes::analysis
  54:     0x7f2b077e4f76 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, (), core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  55:     0x7f2b077e4131 - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::analysis, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  56:     0x7f2b07a6e60a - <rustc_query_impl[81153385010d7886]::Queries as rustc_middle[6dfce017f6b7786d]::ty::query::QueryEngine>::analysis
  57:     0x7f2b0729a010 - <rustc_interface[698bad460dbd68d3]::passes::QueryContext>::enter::<rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  58:     0x7f2b07297a84 - rustc_span[7c23fb27ec020b97]::with_source_map::<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  59:     0x7f2b072902d4 - <scoped_tls[1044df3f3db9be03]::ScopedKey<rustc_span[7c23fb27ec020b97]::SessionGlobals>>::set::<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  60:     0x7f2b0728f9d2 - std[f8b79e573431a86c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[698bad460dbd68d3]::util::run_in_thread_pool_with_globals<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  61:     0x7f2b0728f77a - <<std[f8b79e573431a86c]::thread::Builder>::spawn_unchecked_<rustc_interface[698bad460dbd68d3]::util::run_in_thread_pool_with_globals<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#1} as core[1d432356d8e1e9f1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:     0x7f2b04d73823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3205ec2d7fc232c5
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:1988:9
  63:     0x7f2b04d73823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3bb5daec8177f56b
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:1988:9
  64:     0x7f2b04d73823 - std::sys::unix::thread::Thread::new::thread_start::had7b8061e306bb5c
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys/unix/thread.rs:108:17
  65:     0x7f2b04a94b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  66:     0x7f2b04b26a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  67:                0x0 - <unknown>

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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
```

<!--
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>

```
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:114 ~ cli_game[8b65]::main::'_), '_) }) <= '_#17r

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:     0x7ff258f6659a - std::backtrace_rs::backtrace::libunwind::trace::ha271a8a7e1f3d4ef
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ff258f6659a - std::backtrace_rs::backtrace::trace_unsynchronized::h85739da0352c791a
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ff258f6659a - std::sys_common::backtrace::_print_fmt::hbc6ebcfb2910b329
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ff258f6659a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he1c117e52d53614f
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ff258fc839e - core::fmt::write::h25eb51b9526b8e0c
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/fmt/mod.rs:1213:17
   5:     0x7ff258f56be5 - std::io::Write::write_fmt::ha9edec5fb1621933
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/io/mod.rs:1682:15
   6:     0x7ff258f66365 - std::sys_common::backtrace::_print::hf8657cd429fc3452
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7ff258f66365 - std::sys_common::backtrace::print::h41b9b18ed86f86bd
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7ff258f6912f - std::panicking::default_hook::{{closure}}::h22a91871f4454152
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:267:22
   9:     0x7ff258f68e6b - std::panicking::default_hook::h21ddc36de0cd4ae7
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:286:9
  10:     0x7ff25c2b9324 - rustc_driver[70f63b52fde826b7]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7ff258f6996a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6f7e3c94ecc52e2f
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:2002:9
  12:     0x7ff258f6996a - std::panicking::rust_panic_with_hook::h5059419d6d59b3d0
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:692:13
  13:     0x7ff25c574f81 - std[f8b79e573431a86c]::panicking::begin_panic::<rustc_errors[53e74ce803854a4d]::ExplicitBug>::{closure#0}
  14:     0x7ff25c56d8d6 - std[f8b79e573431a86c]::sys_common::backtrace::__rust_end_short_backtrace::<std[f8b79e573431a86c]::panicking::begin_panic<rustc_errors[53e74ce803854a4d]::ExplicitBug>::{closure#0}, !>
  15:     0x7ff25c5fdda6 - std[f8b79e573431a86c]::panicking::begin_panic::<rustc_errors[53e74ce803854a4d]::ExplicitBug>
  16:     0x7ff25c5fdd96 - std[f8b79e573431a86c]::panic::panic_any::<rustc_errors[53e74ce803854a4d]::ExplicitBug>
  17:     0x7ff25c5fc6c2 - <rustc_errors[53e74ce803854a4d]::HandlerInner>::span_bug::<rustc_span[7c23fb27ec020b97]::span_encoding::Span, &alloc[b346c7f99e9347e5]::string::String>
  18:     0x7ff25c5fc567 - <rustc_errors[53e74ce803854a4d]::Handler>::span_bug::<rustc_span[7c23fb27ec020b97]::span_encoding::Span, &alloc[b346c7f99e9347e5]::string::String>
  19:     0x7ff25c5b1acb - rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}
  20:     0x7ff25c5b1b1a - rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_opt::<rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7ff25c5b0bda - rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_context_opt::<rustc_middle[6dfce017f6b7786d]::ty::context::tls::with_opt<rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt<rustc_span[7c23fb27ec020b97]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7ff25c5b0b06 - rustc_middle[6dfce017f6b7786d]::util::bug::opt_span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>
  23:     0x7ff25c5b0ac4 - rustc_middle[6dfce017f6b7786d]::util::bug::span_bug_fmt::<rustc_span[7c23fb27ec020b97]::span_encoding::Span>
  24:     0x7ff25a244604 - <rustc_middle[6dfce017f6b7786d]::ty::sty::Region as rustc_middle[6dfce017f6b7786d]::ty::relate::Relate>::relate::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  25:     0x7ff25a23ef86 - rustc_middle[6dfce017f6b7786d]::ty::relate::super_relate_tys::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  26:     0x7ff25a23c8be - <rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate as rustc_middle[6dfce017f6b7786d]::ty::relate::TypeRelation>::tys
  27:     0x7ff25a23f6e6 - rustc_middle[6dfce017f6b7786d]::ty::relate::super_relate_tys::<rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate>
  28:     0x7ff25a23c8be - <rustc_infer[83c7bda8c7ffae41]::infer::equate::Equate as rustc_middle[6dfce017f6b7786d]::ty::relate::TypeRelation>::tys
  29:     0x7ff25aacedb3 - <rustc_infer[83c7bda8c7ffae41]::infer::InferCtxt>::commit_if_ok::<rustc_infer[83c7bda8c7ffae41]::infer::InferOk<()>, rustc_middle[6dfce017f6b7786d]::ty::error::TypeError, <rustc_infer[83c7bda8c7ffae41]::infer::at::Trace>::eq<rustc_middle[6dfce017f6b7786d]::ty::Ty>::{closure#0}>
  30:     0x7ff25aaceca6 - <rustc_infer[83c7bda8c7ffae41]::infer::at::At>::eq::<rustc_middle[6dfce017f6b7786d]::ty::Ty>
  31:     0x7ff25ce9739e - <rustc_infer[83c7bda8c7ffae41]::infer::InferCtxt>::can_eq::<rustc_middle[6dfce017f6b7786d]::ty::Ty>
  32:     0x7ff25ce7a1d2 - rustc_trait_selection[d385e741675330b5]::traits::error_reporting::suggestions::hint_missing_borrow
  33:     0x7ff25cf1d934 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  34:     0x7ff25cf2d788 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  35:     0x7ff25cf37167 - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  36:     0x7ff25cf2a7cf - <rustc_infer[83c7bda8c7ffae41]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[d385e741675330b5]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  37:     0x7ff25a4b5b93 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::demand_coerce
  38:     0x7ff25a47e689 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_decl
  39:     0x7ff25a47b773 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_block_with_expected
  40:     0x7ff25a445d3c - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7ff25a3e08d1 - <rustc_hir_typeck[698e9809084ff9ec]::fn_ctxt::FnCtxt>::check_return_expr
  42:     0x7ff25a3d7802 - rustc_hir_typeck[698e9809084ff9ec]::check::check_fn
  43:     0x7ff25a3c00be - rustc_hir_typeck[698e9809084ff9ec]::typeck
  44:     0x7ff25a3b1797 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, rustc_span[7c23fb27ec020b97]::def_id::LocalDefId, &rustc_middle[6dfce017f6b7786d]::ty::typeck_results::TypeckResults>
  45:     0x7ff25a3a92eb - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::typeck, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  46:     0x7ff25ba163cd - rustc_data_structures[560608da72c35763]::sync::par_for_each_in::<&[rustc_span[7c23fb27ec020b97]::def_id::LocalDefId], <rustc_middle[6dfce017f6b7786d]::hir::map::Map>::par_body_owners<rustc_hir_typeck[698e9809084ff9ec]::typeck_item_bodies::{closure#0}>::{closure#0}>
  47:     0x7ff25ba16173 - rustc_hir_typeck[698e9809084ff9ec]::typeck_item_bodies
  48:     0x7ff25ba301d7 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, (), ()>
  49:     0x7ff25b839c26 - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::typeck_item_bodies, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  50:     0x7ff25bc71d5b - <rustc_query_impl[81153385010d7886]::Queries as rustc_middle[6dfce017f6b7786d]::ty::query::QueryEngine>::typeck_item_bodies
  51:     0x7ff25a74eee2 - <rustc_session[cd7c78827427c6d6]::session::Session>::time::<(), rustc_hir_analysis[651175ae4d1746c1]::check_crate::{closure#7}>
  52:     0x7ff25a74e352 - rustc_hir_analysis[651175ae4d1746c1]::check_crate
  53:     0x7ff25a74dfab - rustc_interface[698bad460dbd68d3]::passes::analysis
  54:     0x7ff25b9e4f76 - <rustc_query_system[59807289ca97d521]::dep_graph::graph::DepGraph<rustc_middle[6dfce017f6b7786d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6dfce017f6b7786d]::ty::context::TyCtxt, (), core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  55:     0x7ff25b9e4131 - rustc_query_system[59807289ca97d521]::query::plumbing::try_execute_query::<rustc_query_impl[81153385010d7886]::queries::analysis, rustc_query_impl[81153385010d7886]::plumbing::QueryCtxt>
  56:     0x7ff25bc6e60a - <rustc_query_impl[81153385010d7886]::Queries as rustc_middle[6dfce017f6b7786d]::ty::query::QueryEngine>::analysis
  57:     0x7ff25b49a010 - <rustc_interface[698bad460dbd68d3]::passes::QueryContext>::enter::<rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  58:     0x7ff25b497a84 - rustc_span[7c23fb27ec020b97]::with_source_map::<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  59:     0x7ff25b4902d4 - <scoped_tls[1044df3f3db9be03]::ScopedKey<rustc_span[7c23fb27ec020b97]::SessionGlobals>>::set::<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  60:     0x7ff25b48f9d2 - std[f8b79e573431a86c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[698bad460dbd68d3]::util::run_in_thread_pool_with_globals<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>
  61:     0x7ff25b48f77a - <<std[f8b79e573431a86c]::thread::Builder>::spawn_unchecked_<rustc_interface[698bad460dbd68d3]::util::run_in_thread_pool_with_globals<rustc_interface[698bad460dbd68d3]::interface::run_compiler<core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>, rustc_driver[70f63b52fde826b7]::run_compiler::{closure#1}>::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d432356d8e1e9f1]::result::Result<(), rustc_errors[53e74ce803854a4d]::ErrorGuaranteed>>::{closure#1} as core[1d432356d8e1e9f1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:     0x7ff258f73823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3205ec2d7fc232c5
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:1988:9
  63:     0x7ff258f73823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3bb5daec8177f56b
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/alloc/src/boxed.rs:1988:9
  64:     0x7ff258f73823 - std::sys::unix::thread::Thread::new::thread_start::had7b8061e306bb5c
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys/unix/thread.rs:108:17
  65:     0x7ff258c94b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  66:     0x7ff258d26a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  67:                0x0 - <unknown>

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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
```

</p>
</details>