Repository: rust
Issue: E0631 tries to remove nonexisting borrow?
Labels: A-diagnostics,I-ICE,T-compiler,C-bug,A-suggestion-diagnostics,requires-debug-assertions

<!--
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
pub fn main() {
    fn baz(&self) {}
    let _ = &baz as &dyn Fn(i32);
}
```

Looks like the help message tries to remove something that isnt there?
This causes a debug assertion ice

````
error: `self` parameter is only allowed in associated functions
 --> treereduce.out:2:12
  |
2 |     fn baz(&self) {}
  |            ^^^^^ not semantically valid as function parameter
  |
  = note: associated functions are those in `impl` or `trait` definitions

error[E0631]: type mismatch in function arguments
 --> treereduce.out:3:13
  |
2 |     fn baz(&self) {}
  |     ------------- found signature defined here
3 |     let _ = &baz as &dyn Fn(i32);
  |             ^^^^ expected due to this
  |
  = note: expected function signature `fn(i32) -> _`
             found function signature `for<'a> fn(&'a [type error]) -> _`
  = note: required for the cast from `for<'a> fn(&'a [type error]) {baz}` to the object type `dyn Fn(i32)`
help: do not borrow the argument
  |
2 |     fn baz(&self) {}
  |
````


### 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.71.0-nightly (2f2c438dc 2023-05-08)
binary: rustc
commit-hash: 2f2c438dce75d8cc532c3baa849eeddc0901802c
commit-date: 2023-05-08
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2
```


<!--
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: `self` parameter is only allowed in associated functions
 --> treereduce.out:2:12
  |
2 |     fn baz(&self) {}
  |            ^^^^^ not semantically valid as function parameter
  |
  = note: associated functions are those in `impl` or `trait` definitions

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Some(SubstitutionPart { span: treereduce.out:2:12: 2:12 (#0), snippet: "" })`,
 right: `None`: Span must not be empty and have no suggestion', /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic.rs:627:9
stack backtrace:
   0:     0x7efccad10856 - std::backtrace_rs::backtrace::libunwind::trace::h74804ffdd8fa53e7
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7efccad10856 - std::backtrace_rs::backtrace::trace_unsynchronized::h7428ab2b67b36e0c
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7efccad10856 - std::sys_common::backtrace::_print_fmt::h8de225fa5d864a16
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7efccad10856 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf186862c319ab6b0
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7efccadaf868 - core::fmt::rt::Argument::fmt::h6eb98e918eb80ebd
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/rt.rs:138:9
   5:     0x7efccadaf868 - core::fmt::write::hfa7c5695b2a1784c
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/mod.rs:1094:21
   6:     0x7efccad14aef - std::io::Write::write_fmt::h8780fc8b700f7b89
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/io/mod.rs:1712:15
   7:     0x7efccad10655 - std::sys_common::backtrace::_print::h4ce540e460b36e22
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7efccad10655 - std::sys_common::backtrace::print::h6954c2242c47d1db
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7efccad2b4cc - std::panicking::default_hook::{{closure}}::h7efa3c73d7318a2f
  10:     0x7efccad2b1a2 - std::panicking::default_hook::h478ef42d51f84426
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:288:9
  11:     0x7efccd5d0f5b - <alloc[32b43e9536c01a3]::boxed::Box<dyn for<'a, 'b> core[c5d5d662f7508502]::ops::function::Fn<(&'a core[c5d5d662f7508502]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[c5d5d662f7508502]::marker::Send + core[c5d5d662f7508502]::marker::Sync> as core[c5d5d662f7508502]::ops::function::Fn<(&core[c5d5d662f7508502]::panic::panic_info::PanicInfo,)>>::call
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1999:9
  12:     0x7efccd5d0f5b - rustc_driver_impl[73f6269079133b5d]::install_ice_hook::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver_impl/src/lib.rs:1258:13
  13:     0x7efccad2bd6a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfea6944ca11513b1
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1999:9
  14:     0x7efccad2bd6a - std::panicking::rust_panic_with_hook::h3d7c73761f67633f
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:695:13
  15:     0x7efccad11977 - std::panicking::begin_panic_handler::{{closure}}::h0004dd01860b01c3
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:582:13
  16:     0x7efccad10936 - std::sys_common::backtrace::__rust_end_short_backtrace::hccbfe31830e0f553
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:150:18
  17:     0x7efccad2b8d2 - rust_begin_unwind
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:578:5
  18:     0x7efccadcb403 - core::panicking::panic_fmt::h98b1dd38c1edb68b
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panicking.rs:67:14
  19:     0x7efccadcba5b - core::panicking::assert_failed_inner::h79afe05c154ecdae
  20:     0x7efccf9d03e9 - core[c5d5d662f7508502]::panicking::assert_failed::<core[c5d5d662f7508502]::option::Option<&rustc_errors[1f9d64dc51ea12e9]::SubstitutionPart>, core[c5d5d662f7508502]::option::Option<&rustc_errors[1f9d64dc51ea12e9]::SubstitutionPart>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panicking.rs:228:5
  21:     0x7efccfa94e16 - <rustc_errors[1f9d64dc51ea12e9]::diagnostic::Diagnostic>::multipart_suggestion_with_style::<&str>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic.rs:627:9
  22:     0x7efccfbacd01 - <rustc_errors[1f9d64dc51ea12e9]::diagnostic::Diagnostic>::multipart_suggestion_verbose::<&str>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic.rs:604:9
  23:     0x7efccfbacd01 - rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::suggestions::hint_missing_borrow
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs:4038:13
  24:     0x7efccfa2bdc8 - <rustc_infer[a2985abf94f640d0]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs:2114:13
  25:     0x7efccfa44142 - <rustc_infer[a2985abf94f640d0]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::InferCtxtPrivExt>::report_type_parameter_mismatch_error
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:3115:17
  26:     0x7efccfa3a602 - <rustc_infer[a2985abf94f640d0]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1101:23
  27:     0x7efccfa4b3ab - <rustc_infer[a2985abf94f640d0]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1396:17
  28:     0x7efccfa388c4 - <rustc_infer[a2985abf94f640d0]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[5b4da324d8e50422]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:462:21
  29:     0x7efccdbbd130 - <rustc_hir_typeck[42d6e0e094c9f4b8]::fn_ctxt::FnCtxt>::select_obligations_where_possible::<rustc_hir_typeck[42d6e0e094c9f4b8]::typeck_with_fallback<rustc_hir_typeck[42d6e0e094c9f4b8]::diagnostic_only_typeck::{closure#0}>::{closure#0}::{closure#2}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:598:13
  30:     0x7efccdc8fc2c - rustc_hir_typeck[42d6e0e094c9f4b8]::typeck_with_fallback::<rustc_hir_typeck[42d6e0e094c9f4b8]::typeck::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:271:5
  31:     0x7efccdc8fc2c - rustc_hir_typeck[42d6e0e094c9f4b8]::typeck_with_fallback::<rustc_hir_typeck[42d6e0e094c9f4b8]::typeck::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:175:36
  32:     0x7efccdc8fc2c - rustc_hir_typeck[42d6e0e094c9f4b8]::typeck
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:157:5
  33:     0x7efccf222a3c - <rustc_query_impl[ebac30efce9578e8]::queries::typeck as rustc_query_system[21b2b7f41118700]::query::config::QueryConfig<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>>::compute
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:566:21
  34:     0x7efccf222a3c - rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:464:72
  35:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context::<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  36:     0x7efccf222a3c - <std[68c29493de10bea]::thread::local::LocalKey<core[c5d5d662f7508502]::cell::Cell<*const ()>>>::try_with::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:270:16
  37:     0x7efccf222a3c - <std[68c29493de10bea]::thread::local::LocalKey<core[c5d5d662f7508502]::cell::Cell<*const ()>>>::with::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:246:9
  38:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context::<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:9
  39:     0x7efccf222a3c - <rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query::<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:148:13
  40:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context::<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:133:9
  41:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_context::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:36
  42:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_context_opt::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_context<rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:100:18
  43:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_context::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:5
  44:     0x7efccf222a3c - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context::<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:124:5
  45:     0x7efccf222a3c - <rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query::<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:133:9
  46:     0x7efccf222a3c - rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:464:18
  47:     0x7efccf222a3c - rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:402:17
  48:     0x7efccf222a3c - rustc_query_system[21b2b7f41118700]::query::plumbing::try_execute_query::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:358:13
  49:     0x7efccf49a4e8 - rustc_query_system[21b2b7f41118700]::query::plumbing::get_query::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:824:36
  50:     0x7efccf49a4e8 - stacker[7db3bd1b0a5e56b0]::maybe_grow::<(rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, core[c5d5d662f7508502]::option::Option<rustc_query_system[21b2b7f41118700]::dep_graph::graph::DepNodeIndex>), rustc_query_system[21b2b7f41118700]::query::plumbing::get_query<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9
  51:     0x7efccf49a4e8 - rustc_data_structures[bdfdc77573217e6b]::stack::ensure_sufficient_stack::<(rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, core[c5d5d662f7508502]::option::Option<rustc_query_system[21b2b7f41118700]::dep_graph::graph::DepNodeIndex>), rustc_query_system[21b2b7f41118700]::query::plumbing::get_query<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/stack.rs:17:5
  52:     0x7efccf49a4e8 - rustc_query_system[21b2b7f41118700]::query::plumbing::get_query::<rustc_query_impl[ebac30efce9578e8]::queries::typeck, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:824:9
  53:     0x7efccf49a4e8 - rustc_query_impl[ebac30efce9578e8]::get_query::typeck
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:493:21
  54:     0x7efccdc71f60 - rustc_middle[6f3733109ea8fff4]::ty::query::query_get_at::<rustc_query_system[21b2b7f41118700]::query::caches::VecCache<rustc_span[d70028f630b101c7]::def_id::LocalDefId, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:219:17
  55:     0x7efccdc8edb2 - <rustc_middle[6f3733109ea8fff4]::ty::query::TyCtxtAt>::typeck::<rustc_span[d70028f630b101c7]::def_id::LocalDefId>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:483:31
  56:     0x7efccdc8edb2 - <rustc_middle[6f3733109ea8fff4]::ty::context::TyCtxt>::typeck::<rustc_span[d70028f630b101c7]::def_id::LocalDefId>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:474:35
  57:     0x7efccdc8edb2 - rustc_hir_typeck[42d6e0e094c9f4b8]::used_trait_imports
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:152:11
  58:     0x7efccf16260a - <rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports as rustc_query_system[21b2b7f41118700]::query::config::QueryConfig<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>>::compute
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:566:21
  59:     0x7efccf16260a - rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr::<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:464:72
  60:     0x7efccf16260a - rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context::<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  61:     0x7efccf16260a - <std[68c29493de10bea]::thread::local::LocalKey<core[c5d5d662f7508502]::cell::Cell<*const ()>>>::try_with::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:270:16
  62:     0x7efccf16260a - <std[68c29493de10bea]::thread::local::LocalKey<core[c5d5d662f7508502]::cell::Cell<*const ()>>>::with::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:246:9
  63:     0x7efccf16260a - rustc_middle[6f3733109ea8fff4]::ty::context::tls::enter_context::<rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:9
  64:     0x7efccf16260a - <rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query::<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:148:13
  65:     0x7efccf16260a - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context::<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:133:9
  66:     0x7efccf16260a - rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_context::<rustc_middle[6f3733109ea8fff4]::ty::context::tls::with_related_context<<rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt as rustc_query_system[21b2b7f41118700]::query::QueryContext>::start_query<rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[21b2b7f41118700]::query::plumbing::execute_job_non_incr<rustc_query_impl[ebac30efce9578e8]::queries::used_trait_imports, rustc_query_impl[ebac30efce9578e8]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[6f3733109ea8fff4]::query::erase::Erased<[u8; 8usize]>>::{closure#0}
.....


                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panic.rs:140:14
 131:     0x7efccd5e71b5 - <std[68c29493de10bea]::thread::Builder>::spawn_unchecked_::<rustc_interface[d91a28e9ec7fdd1a]::util::run_in_thread_pool_with_globals<rustc_interface[d91a28e9ec7fdd1a]::interface::run_compiler<core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>, rustc_driver_impl[73f6269079133b5d]::run_compiler::{closure#1}>::{closure#0}, core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>>::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/mod.rs:528:30
 132:     0x7efccd5e71b5 - <<std[68c29493de10bea]::thread::Builder>::spawn_unchecked_<rustc_interface[d91a28e9ec7fdd1a]::util::run_in_thread_pool_with_globals<rustc_interface[d91a28e9ec7fdd1a]::interface::run_compiler<core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>, rustc_driver_impl[73f6269079133b5d]::run_compiler::{closure#1}>::{closure#0}, core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c5d5d662f7508502]::result::Result<(), rustc_span[d70028f630b101c7]::ErrorGuaranteed>>::{closure#1} as core[c5d5d662f7508502]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/ops/function.rs:250:5
 133:     0x7efccad1cf7a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h59b61553bfddebc8
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1985:9
 134:     0x7efccad1cf7a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0ce3d7a7bade6491
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1985:9
 135:     0x7efccad03285 - std::sys::unix::thread::Thread::new::thread_start::h6e446945f062d041
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys/unix/thread.rs:108:17
 136:     0x7efccaaa4bb5 - <unknown>
 137:     0x7efccab26d90 - <unknown>
 138:                0x0 - <unknown>

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: rustc 1.71.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `main`
#1 [used_trait_imports] finding used_trait_imports `main`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
```

</p>
</details>


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"Ezrashaw"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->