-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as duplicate of#140730
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
fn main() {
let mut robots: Vec<u64> = vec![7];
if &robots[0..1].iter().filter(|r| r > 0).count() >= 1 {
}
}
Meta
rustc --version --verbose
:
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: x86_64-pc-windows-msvc
release: 1.88.0
LLVM version: 20.1.5
Error output
Compiling day_14 v0.1.0 (C:\Users\Rogers-Eier\projects\adventOfCode\day_14)
error[E0308]: mismatched types
--> src\main.rs:4:44
|
4 | if &robots[0..1].iter().filter(|r| r > 0).count() >= 1 {
| ^ expected `&&u64`, found integer
thread 'rustc' panicked at compiler\rustc_hir_typeck\src\gather_locals.rs:112:17:
assertion `left == right` failed
left: Some(?28t)
right: None
stack backtrace:
0: 0x7ffe91aea9c2 - std::backtrace_rs::backtrace::win64::trace
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
1: 0x7ffe91aea9c2 - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ffe91aea9c2 - std::sys::backtrace::_print_fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:66
3: 0x7ffe91aea9c2 - std::sys::backtrace::impl$0::print::impl$0::fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:39
4: 0x7ffe91b1d18b - core::fmt::rt::Argument::fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\fmt\rt.rs:181
5: 0x7ffe91b1d18b - core::fmt::write
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\fmt\mod.rs:1446
6: 0x7ffe91ae0b17 - std::io::default_write_fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\io\mod.rs:639
7: 0x7ffe91ae0b17 - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\io\mod.rs:1914
8: 0x7ffe91aea805 - std::sys::backtrace::BacktraceLock::print
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:42
9: 0x7ffe91af045a - std::panicking::default_hook::closure$0
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:300
10: 0x7ffe91af01f0 - std::panicking::default_hook
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:327
11: 0x7ffe9320f589 - core[3c86ab912ec38c67]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[852ad02eb4e36d75]::Level, &str), usize), <((rustc_lint_defs[852ad02eb4e36d75]::Level, &str), usize) as core[3c86ab912ec38c67]::cmp::PartialOrd>::lt>
12: 0x7ffe91af10ee - std::panicking::rust_panic_with_hook
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:841
13: 0x7ffe91af0e49 - std::panicking::begin_panic_handler::closure$0
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:706
14: 0x7ffe91aeb78f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:168
15: 0x7ffe91af0a4e - std::panicking::begin_panic_handler
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:697
16: 0x7ffe94c9e001 - core::panicking::panic_fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\panicking.rs:75
17: 0x7ffe94c9e534 - core::panicking::assert_failed_inner
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\panicking.rs:428
18: 0x7ffe9441b85a - core[3c86ab912ec38c67]::panicking::assert_failed::<core[3c86ab912ec38c67]::option::Option<rustc_middle[415f7117aa72a916]::ty::Ty>, core[3c86ab912ec38c67]::option::Option<rustc_middle[415f7117aa72a916]::ty::Ty>>
19: 0x7ffe91cfc7e6 - <rustc_hir_typeck[e308a3f77b43efe0]::gather_locals::GatherLocalsVisitor as rustc_hir[c9ebc9117bf478f1]::intravisit::Visitor>::visit_pat
20: 0x7ffe91d58b83 - rustc_hir_typeck[e308a3f77b43efe0]::typeck
21: 0x7ffe91d5d712 - rustc_hir_typeck[e308a3f77b43efe0]::typeck
22: 0x7ffe91c94c30 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
23: 0x7ffe91cede5e - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
24: 0x7ffe91c914a6 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
25: 0x7ffe91c907dd - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
26: 0x7ffe91c90c9c - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
27: 0x7ffe93672fcc - <rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::inspect_obligations::NestedObligationsForSelfTy as rustc_trait_selection[8e400bafa0bead0e]::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
28: 0x7ffe936617a6 - <rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::inspect_obligations::NestedObligationsForSelfTy as rustc_trait_selection[8e400bafa0bead0e]::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
29: 0x7ffe9360fb21 - rustc_hir_typeck[e308a3f77b43efe0]::coercion::can_coerce
30: 0x7ffe93615a77 - rustc_hir_typeck[e308a3f77b43efe0]::coercion::can_coerce
31: 0x7ffe91d23208 - rustc_hir_typeck[e308a3f77b43efe0]::method::probe::method_autoderef_steps
32: 0x7ffe91c915a6 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
33: 0x7ffe91c92413 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
34: 0x7ffe91cbb514 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
35: 0x7ffe91c923e2 - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
36: 0x7ffe91cf568e - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
37: 0x7ffe91c9069e - <<rustc_hir_typeck[e308a3f77b43efe0]::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir[ca772ffc72eafe18]::visit::TypeVisitor<rustc_middle[415f7117aa72a916]::ty::context::TyCtxt>>::visit_ty
38: 0x7ffe91d59215 - rustc_hir_typeck[e308a3f77b43efe0]::typeck
39: 0x7ffe91da4a56 - <rustc_hir_typeck[e308a3f77b43efe0]::upvar::InferBorrowKind as rustc_hir_typeck[e308a3f77b43efe0]::expr_use_visitor::Delegate>::borrow
40: 0x7ffe91d588bf - rustc_hir_typeck[e308a3f77b43efe0]::typeck
41: 0x7ffe92a3f48b - rustc_query_impl[dbd98c1d837197ef]::plumbing::query_key_hash_verify_all
42: 0x7ffe92979863 - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id10LocalDefIdINtNtNtCs5BYDmTWcnKQ
43: 0x7ffe92a47861 - rustc_query_impl[dbd98c1d837197ef]::plumbing::query_key_hash_verify_all
44: 0x7ffe91ddf89a - RINvMs6_NtCsdskSw9gvGQH_9hashbrown3rawINtB6_8RawTablejE14reserve_rehashNCINvNtNtCslPPgtOmP3yY_8indexmap3map4core8get_hashTNtNtNtCs5BYDmTWcnKQ_12rustc_middle2ty9predicate6ClauseNtNtCs5K2xb0UU2Jw_10rustc_span13span_encoding4SpanEuE0ECscM8KGpa8HpW_18rustc_hir
45: 0x7ffe91e7d7a3 - rustc_hir_analysis[94d0c1ae99f150b6]::check_crate
46: 0x7ffe91b54868 - <rustc_interface[cdf4984d0e22fb97]::passes::LintStoreExpandImpl as rustc_expand[eb94a41e01d8b712]::base::LintStoreExpand>::pre_expansion_lint
47: 0x7ffe8e0ddb57 - rustc_interface[cdf4984d0e22fb97]::passes::analysis
48: 0x7ffe9166e0ba - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id8CrateNumINtNtNtCs5BYDmTWcnKQ_12
49: 0x7ffe91577a7c - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs5BYDmTWcnKQ_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
50: 0x7ffe916745dc - rustc_query_impl[dbd98c1d837197ef]::query_system
51: 0x7ffe8e09ecc5 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
52: 0x7ffe8e098f23 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
53: 0x7ffe8e0947af - RINvNtNtCsja4ZeDc2XAj_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCshGilUj5gLc1_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCsbbk6E3yTTQl_17rustc_driver_i
54: 0x7ffe8e0a3020 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
55: 0x7ffe91af545d - alloc::boxed::impl$28::call_once
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\alloc\src\boxed.rs:1966
56: 0x7ffe91af545d - alloc::boxed::impl$28::call_once
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\alloc\src\boxed.rs:1966
57: 0x7ffe91af545d - std::sys::pal::windows::thread::impl$0::new::thread_start
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\pal\windows\thread.rs:56
58: 0x7fff280d7374 - BaseThreadInitThunk
59: 0x7fff28afcc91 - 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.88.0 (6b00bc388 2025-06-23) 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
query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0308`.
error: could not compile `day_14` (bin "day_14") due to 1 previous error
Backtrace
thread 'rustc' panicked at compiler\rustc_hir_typeck\src\gather_locals.rs:112:17:
assertion `left == right` failed
left: Some(?28t)
right: None
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:697
1: core::panicking::panic_fmt
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\panicking.rs:75
2: core::panicking::assert_failed_inner
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\panicking.rs:428
3: core::panicking::assert_failed::<core::option::Option<rustc_middle::ty::Ty>, core::option::Option<rustc_middle::ty::Ty>>
4: <rustc_hir_typeck::gather_locals::GatherLocalsVisitor as rustc_hir::intravisit::Visitor>::visit_pat
5: rustc_hir_typeck::typeck
6: rustc_hir_typeck::typeck
7: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
8: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
9: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
10: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
11: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
12: <rustc_hir_typeck::fn_ctxt::inspect_obligations::NestedObligationsForSelfTy as rustc_trait_selection::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
13: <rustc_hir_typeck::fn_ctxt::inspect_obligations::NestedObligationsForSelfTy as rustc_trait_selection::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
14: rustc_hir_typeck::coercion::can_coerce
15: rustc_hir_typeck::coercion::can_coerce
16: rustc_hir_typeck::method::probe::method_autoderef_steps
17: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
18: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
19: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
20: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
21: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
22: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
23: rustc_hir_typeck::typeck
24: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::borrow
25: rustc_hir_typeck::typeck
26: rustc_query_impl::plumbing::query_key_hash_verify_all
27: RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id10LocalDefIdINtNtNtCs5BYDmTWcnKQ
28: rustc_query_impl::plumbing::query_key_hash_verify_all
29: RINvMs6_NtCsdskSw9gvGQH_9hashbrown3rawINtB6_8RawTablejE14reserve_rehashNCINvNtNtCslPPgtOmP3yY_8indexmap3map4core8get_hashTNtNtNtCs5BYDmTWcnKQ_12rustc_middle2ty9predicate6ClauseNtNtCs5K2xb0UU2Jw_10rustc_span13span_encoding4SpanEuE0ECscM8KGpa8HpW_18rustc_hir
30: rustc_hir_analysis::check_crate
31: <rustc_interface::passes::LintStoreExpandImpl as rustc_expand::base::LintStoreExpand>::pre_expansion_lint
32: rustc_interface::passes::analysis
33: RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id8CrateNumINtNtNtCs5BYDmTWcnKQ_12
34: RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs5BYDmTWcnKQ_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
35: rustc_query_impl::query_system
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.