Skip to content

internal compiler error: two identical projections #137467

@HomelikeBrick42

Description

@HomelikeBrick42

Code

I dont really want to make a MRE right now, so this is the entire project
https://github.com/HomelikeBrick42/4dStuff/tree/rustc_bug

Meta

rustc --version --verbose:

rustc 1.85.0 (4d91de4e4 2025-02-17)
binary: rustc
commit-hash: 4d91de4e48198da2e33413efdcd9cd2cc0c46688
commit-date: 2025-02-17
host: x86_64-pc-windows-msvc
release: 1.85.0
LLVM version: 19.1.7

Error output

thread 'rustc' panicked at compiler\rustc_mir_build\src\builder\matches\mod.rs:2087:44:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7ffbef3001c1 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffbef3001c1 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffbef3001c1 - std::sys::backtrace::_print_fmt
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\sys\backtrace.rs:66
   3:     0x7ffbef3001c1 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\sys\backtrace.rs:39
   4:     0x7ffbef332cca - core::fmt::rt::Argument::fmt
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\core\src\fmt\rt.rs:177
   5:     0x7ffbef332cca - core::fmt::write
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\core\src\fmt\mod.rs:1440
   6:     0x7ffbef2f5b07 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\io\mod.rs:1887
   7:     0x7ffbef300005 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\sys\backtrace.rs:42
   8:     0x7ffbef302fad - std::panicking::default_hook::closure$1
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\panicking.rs:295
   9:     0x7ffbef302d10 - std::panicking::default_hook
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\panicking.rs:322
  10:     0x7ffbf08f533a - core[13dd8dac7b8322e0]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[84e5be47eb57ee2d]::Level, &str), usize), <((rustc_lint_defs[84e5be47eb57ee2d]::Level, &str), usize) as core[13dd8dac7b8322e0]::cmp::PartialOrd>::lt>
  11:     0x7ffbef30389e - alloc::boxed::impl$30::call
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\alloc\src\boxed.rs:2007
  12:     0x7ffbef30389e - std::panicking::rust_panic_with_hook
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\panicking.rs:836
  13:     0x7ffbef3035c2 - std::panicking::begin_panic_handler::closure$0
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\panicking.rs:694
  14:     0x7ffbef300c9f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\sys\backtrace.rs:168
  15:     0x7ffbef3031fe - std::panicking::begin_panic_handler
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\panicking.rs:692
  16:     0x7ffbf21b2e41 - core::panicking::panic_fmt
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\core\src\panicking.rs:75
  17:     0x7ffbf21b2efd - core::panicking::panic
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\core\src\panicking.rs:145
  18:     0x7ffbf21b2dbe - core::option::unwrap_failed
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\core\src\option.rs:2015
  19:     0x7ffbef8b443d - rustc_mir_build[74ebac55960bf4f1]::builder::mir_build
  20:     0x7ffbef8f4195 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  21:     0x7ffbef8f4792 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  22:     0x7ffbef8b1b6f - rustc_mir_build[74ebac55960bf4f1]::builder::mir_build
  23:     0x7ffbeec6ff45 - <alloc[f42caee64323a5c9]::raw_vec::RawVec<rustc_data_structures[b27a1c9e0d2e22bf]::graph::iterate::Event<rustc_middle[76d8ed0cc97ff880]::mir::BasicBlock>>>::grow_one
  24:     0x7ffbef8965e5 - rustc_mir_build[74ebac55960bf4f1]::builder::mir_build
  25:     0x7ffbef8e772c - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  26:     0x7ffbef8e6fb4 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  27:     0x7ffbef8e95b1 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  28:     0x7ffbef8e6fb4 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  29:     0x7ffbef895f07 - rustc_mir_build[74ebac55960bf4f1]::builder::mir_build
  30:     0x7ffbef8e772c - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  31:     0x7ffbef8e6fb4 - rustc_mir_build[74ebac55960bf4f1]::thir::pattern::check_match::check_match
  32:     0x7ffbef86cfa3 - rustc_mir_build[74ebac55960bf4f1]::builder::mir_build
  33:     0x7ffbef74c43b - rustc_mir_transform[5978154a3d28926b]::mir_built
  34:     0x7ffbf009b9eb - rustc_query_impl[cd955f68236d2689]::plumbing::query_key_hash_verify_all
  35:     0x7ffbeffe0a4b - RINvNtNtCs8Ehw5TsioVt_18rustc_query_system5query8plumbing17try_execute_queryINtCshEjB07rFK3d_16rustc_query_impl13DynamicConfigINtNtCsfk1N0zTQ1Ep_21rustc_data_structures9vec_cache8VecCacheNtNtCs8yPNJtyUAIM_10rustc_span6def_id10LocalDefIdINtNtNtCsacCxZy8tNDM
  36:     0x7ffbeeeee56e - rustc_query_impl[cd955f68236d2689]::query_system
  37:     0x7ffbeec7444e - <alloc[f42caee64323a5c9]::raw_vec::RawVec<rustc_data_structures[b27a1c9e0d2e22bf]::graph::iterate::Event<rustc_middle[76d8ed0cc97ff880]::mir::BasicBlock>>>::grow_one
  38:     0x7ffbef8ca332 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_expr
  39:     0x7ffbef8cb846 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_expr
  40:     0x7ffbef8ca332 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_expr
  41:     0x7ffbef8c9362 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_block
  42:     0x7ffbef8cb873 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_expr
  43:     0x7ffbef8ca332 - <rustc_mir_build[74ebac55960bf4f1]::check_unsafety::UnsafetyVisitor as rustc_middle[76d8ed0cc97ff880]::thir::visit::Visitor>::visit_expr
  44:     0x7ffbef8cc53d - rustc_mir_build[74ebac55960bf4f1]::check_unsafety::check_unsafety
  45:     0x7ffbf0099c3a - rustc_query_impl[cd955f68236d2689]::plumbing::query_key_hash_verify_all
  46:     0x7ffbeffd4bce - RINvNtNtCs8Ehw5TsioVt_18rustc_query_system5query8plumbing17try_execute_queryINtCshEjB07rFK3d_16rustc_query_impl13DynamicConfigINtNtCsfk1N0zTQ1Ep_21rustc_data_structures9vec_cache8VecCacheNtNtCs8yPNJtyUAIM_10rustc_span6def_id10LocalDefIdINtNtNtCsacCxZy8tNDM
  47:     0x7ffbf00a344b - rustc_query_impl[cd955f68236d2689]::plumbing::query_key_hash_verify_all
  48:     0x7ffbef37b86e - rustc_interface[891a09a0cea1e8ed]::passes::resolver_for_lowering_raw
  49:     0x7ffbec337dde - rustc_interface[891a09a0cea1e8ed]::passes::analysis
  50:     0x7ffbeeee509a - <alloc[f42caee64323a5c9]::sync::Arc<rustc_session[a1380b7e7bd1e9c4]::cstore::CrateSource>>::drop_slow
  51:     0x7ffbeede9ca6 - RINvNtNtCs8Ehw5TsioVt_18rustc_query_system5query8plumbing17try_execute_queryINtCshEjB07rFK3d_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCsacCxZy8tNDM_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  52:     0x7ffbeeeeac44 - rustc_query_impl[cd955f68236d2689]::query_system
  53:     0x7ffbec2fe3c9 - RINvNtNtCsaor5jccb5ur_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCskXJAKvAmGc7_5alloc5boxed3BoxDINtNtNtCs1HK5c7eE0eW_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs13K
  54:     0x7ffbec2f6d9e - RINvNtNtCsaor5jccb5ur_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCskXJAKvAmGc7_5alloc5boxed3BoxDINtNtNtCs1HK5c7eE0eW_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs13K
  55:     0x7ffbec2efe09 - RINvNtNtCsaor5jccb5ur_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCsbLMVCc8CHyP_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs13KITJ2Zc2G_17rustc_driver_i
  56:     0x7ffbec302ea5 - RINvNtNtCsaor5jccb5ur_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCskXJAKvAmGc7_5alloc5boxed3BoxDINtNtNtCs1HK5c7eE0eW_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs13K
  57:     0x7ffbef3157cd - alloc::boxed::impl$28::call_once
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\alloc\src\boxed.rs:1993
  58:     0x7ffbef3157cd - alloc::boxed::impl$28::call_once
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\alloc\src\boxed.rs:1993
  59:     0x7ffbef3157cd - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library\std\src\sys\pal\windows\thread.rs:56
  60:     0x7ffcb58c259d - BaseThreadInitThunk
  61:     0x7ffcb620af38 - 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.85.0 (4d91de4e4 2025-02-17) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -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 [mir_built] building MIR for `<impl at src\lib.rs:68:1: 68:23>::draw_ui::{closure#0}`
#1 [check_unsafety] unsafety-checking `<impl at src\lib.rs:68:1: 68:23>::draw_ui`
end of query stack
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: two identical projections: ([Projection { ty: Camera, kind: Deref }, Projection { ty: transform::Transform, kind: Field(0, 1) }], [Projection { ty: Camera, kind: Deref }, Projection { ty: transform::Transform, kind: Field(0, 0) }])
  --> src\lib.rs:75:23
   |
75 |           ui.horizontal(|ui| {
   |  _______________________^
76 | |             ui.label("Position: ");
77 | |             if position.draw_ui(ui) {
78 | |                 let difference = position - old_position;
...  |
87 | |         });
   | |_________^
   |
note: delayed at compiler\rustc_hir_typeck\src\upvar.rs:931:28 - disabled backtrace
  --> src\lib.rs:75:23
   |
75 |           ui.horizontal(|ui| {
   |  _______________________^
76 | |             ui.label("Position: ");
77 | |             if position.draw_ui(ui) {
78 | |                 let difference = position - old_position;
...  |
87 | |         });
   | |_________^

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.85.0 (4d91de4e4 2025-02-17) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -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:
end of query stack
warning: `ray_tracer` (lib) generated 1 warning
error: could not compile `ray_tracer` (lib); 1 warning emitted

Metadata

Metadata

Assignees

Labels

A-patternsRelating to patterns and pattern matchingC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions