Repository: rust
Issue: Trying to compile my project but it fails.
Labels: I-ICE,T-compiler,A-inference,C-bug,E-needs-mcve

(https://github.com/troindx/oxidize/tree/bug-rust)

### Meta

```
 rustc --version --verbose
rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-pc-windows-msvc
release: 1.78.0
```

### Error output

```
 Compiling oxidize v0.1.0 (C:\Users\troin\www\oxidize)
thread 'rustc' panicked at compiler\rustc_resolve\src\late\diagnostics.rs:821:61:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7fff322e33ca - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:99
   1:     0x7fff322e33ca - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7fff322e33ca - std::sys_common::backtrace::_print_fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:68
   3:     0x7fff322e33ca - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:44
   4:     0x7fff3231634b - core::fmt::rt::Argument::fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\fmt\rt.rs:142
   5:     0x7fff3231634b - core::fmt::write
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\fmt\mod.rs:1153
   6:     0x7fff322d9ac1 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\io\mod.rs:1843
   7:     0x7fff322e31b6 - std::sys_common::backtrace::print
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:34
   8:     0x7fff322e661f - std::panicking::default_hook::closure$1
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:272
   9:     0x7fff322e62b7 - std::panicking::default_hook
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:292
  10:     0x7fff36dba021 - __longjmp_internal
  11:     0x7fff322e6c4c - alloc::boxed::impl$49::call
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\alloc\src\boxed.rs:2034
  12:     0x7fff322e6c4c - std::panicking::rust_panic_with_hook
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:783
  13:     0x7fff322e6a9b - std::panicking::begin_panic_handler::closure$0
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:649
  14:     0x7fff322e3cd9 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:171
  15:     0x7fff322e6796 - std::panicking::begin_panic_handler
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
  16:     0x7fff3233cec7 - core::panicking::panic_fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
  17:     0x7fff3233cfa2 - core::panicking::panic
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:145
  18:     0x7fff3233ce68 - core::option::unwrap_failed
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\option.rs:1985
  19:     0x7fff37420a2f - <rustc_resolve[26bc76c62b7d8db7]::imports::ImportKind as core[a12e26040cc72c4]::fmt::Debug>::fmt
  20:     0x7fff37441534 - <rustc_abi[88a48d514936624a]::ReprFlags as core[a12e26040cc72c4]::fmt::UpperHex>::fmt
  21:     0x7fff3625abc8 - <rustc_resolve[26bc76c62b7d8db7]::Resolver>::into_outputs
  22:     0x7fff361fc7d0 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_poly_trait_ref
  23:     0x7fff361abf95 - <rustc_ast_lowering[bce38aa82744cf9a]::LoweringContext>::lower_generic_param
  24:     0x7fff361fa5c0 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_ty
  25:     0x7fff361faf4d - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_ty
  26:     0x7fff362041d4 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_generic_arg
  27:     0x7fff361faf0d - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_ty
  28:     0x7fff361b1f5c - <rustc_ast_lowering[bce38aa82744cf9a]::LoweringContext>::lower_generic_param
  29:     0x7fff361e0a35 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_item
  30:     0x7fff3620f083 - <<rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor>::find_lifetime_for_self::SelfVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_ty
  31:     0x7fff3620fb12 - <<rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor>::find_lifetime_for_self::SelfVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_ty
  32:     0x7fff3625861c - <rustc_resolve[26bc76c62b7d8db7]::Resolver>::into_outputs
  33:     0x7fff361df135 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_item
  34:     0x7fff361b2013 - <rustc_ast_lowering[bce38aa82744cf9a]::LoweringContext>::lower_generic_param
  35:     0x7fff361e19f6 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_item
  36:     0x7fff361b2013 - <rustc_ast_lowering[bce38aa82744cf9a]::LoweringContext>::lower_generic_param
  37:     0x7fff361e19f6 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_item
  38:     0x7fff361b2013 - <rustc_ast_lowering[bce38aa82744cf9a]::LoweringContext>::lower_generic_param
  39:     0x7fff361e19f6 - <rustc_resolve[26bc76c62b7d8db7]::late::LateResolutionVisitor as rustc_ast[97cebbd51378ca2]::visit::Visitor>::visit_item
  40:     0x7fff362343bd - <rustc_resolve[26bc76c62b7d8db7]::Resolver>::into_outputs
  41:     0x7fff35623444 - <rustc_resolve[26bc76c62b7d8db7]::Resolver>::resolve_crate
  42:     0x7fff35aeb535 - <rustc_interface[c379e6340dfc8ff4]::passes::LintStoreExpandImpl as rustc_expand[ac7fa28d9271a0f1]::base::LintStoreExpand>::pre_expansion_lint
  43:     0x7fff3575ede1 - <rustc_mir_dataflow[c558c2d92ad223ea]::value_analysis::Map>::find_discr
  44:     0x7fff3574802d - <rustc_mir_dataflow[c558c2d92ad223ea]::value_analysis::Map>::find_discr
  45:     0x7fff356d2518 - <rustc_mir_dataflow[c558c2d92ad223ea]::value_analysis::Map>::find_discr
  46:     0x7fff3576642e - rustc_query_impl[35a1e4ec0f2bf1cb]::query_system
  47:     0x7fff359ee962 - <rustc_middle[df39feebc6eef2ee]::ty::context::TyCtxt>::resolver_for_lowering
  48:     0x7fff32b6413e - __ImageBase
  49:     0x7fff32b61777 - __ImageBase
  50:     0x7fff32b692b0 - __ImageBase
  51:     0x7fff322f7d3c - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys\pal\windows\thread.rs:54
  52:     0x7fffb9cc7344 - BaseThreadInitThunk
  53:     0x7fffb9e426b1 - RtlUserThreadStart

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.78.0 (9b00956e5 2024-04-29) running on x86_64-pc-windows-msvc

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

```

  
I am a noob at rust, just trying to teach myself how to code in rust when this showed up.