Skip to content

ICE: LocalTableInContext: key not found #142525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matthiaskrgr opened this issue Jun 15, 2025 · 1 comment · Fixed by #142587
Closed

ICE: LocalTableInContext: key not found #142525

matthiaskrgr opened this issue Jun 15, 2025 · 1 comment · Fixed by #142587
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

use std::arch::x86_64::_mm_blend_ps;

pub fn main() {
     _mm_blend_ps(3_usize, 2, &[
    Exhibit {
        ,
        factory: |_| unimplemented!(),
    },
    Exhibit {
        ,
        ,
    },
] );
}

original:

use std::arch::x86_64::_mm_blend_ps;

pub fn main() {
     _mm_blend_ps(3_usize, 2, &[
    Exhibit {
        constant: 1,
        factory: |_| unimplemented!(),
    },
    Exhibit {
        constant: "Hello world".len(),
        factory: |_| unimplemented!(),
    },
] );
}

Version information

rustc 1.89.0-nightly (32b51523f 2025-06-15)
binary: rustc
commit-hash: 32b51523f81a5f916c4bb3fee5a749721f19e01d
commit-date: 2025-06-15
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: expected identifier, found `,`
 --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:6:9
  |
5 |     Exhibit {
  |     ------- while parsing this struct
6 |         ,
  |         ^ expected identifier
  |
help: remove this comma
  |
6 -         ,
  |

error: expected identifier, found `,`
  --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:10:9
   |
9  |     Exhibit {
   |     ------- while parsing this struct
10 |         ,
   |         ^ expected identifier

error: expected identifier, found `,`
  --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:11:9
   |
9  |     Exhibit {
   |     ------- while parsing this struct
10 |         ,
11 |         ,
   |         ^ expected identifier

error[E0422]: cannot find struct, variant or union type `Exhibit` in this scope
 --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:5:5
  |
5 |     Exhibit {
  |     ^^^^^^^ not found in this scope

error[E0422]: cannot find struct, variant or union type `Exhibit` in this scope
 --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:9:5
  |
9 |     Exhibit {
  |     ^^^^^^^ not found in this scope

error[E0308]: arguments to this function are incorrect
   --> /tmp/icemaker_global_tempdir.shyi2WjDizfE/rustc_testrunner_tmpdir_reporting.JV8NN60yvR7w/mvce.rs:4:6
    |
4   |      _mm_blend_ps(3_usize, 2, &[
    |      ^^^^^^^^^^^^ -------  - expected `__m128`, found integer
    |                   |
    |                   expected `__m128`, found `usize`
    |
note: function defined here
   --> /home/matthias/.rustup/toolchains/master/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse41.rs:163:8
    |
163 | pub fn _mm_blend_ps<const IMM4: i32>(a: __m128, b: __m128) -> __m128 {
    |        ^^^^^^^^^^^^

error: internal compiler error: /rustc-dev/32b51523f81a5f916c4bb3fee5a749721f19e01d/compiler/rustc_middle/src/ty/typeck_results.rs:617:13: LocalTableInContext(DefId(0:4 ~ mvce[f249]::main)): key HirId(DefId(0:4 ~ mvce[f249]::main).10) not found


thread 'rustc' panicked at /rustc-dev/32b51523f81a5f916c4bb3fee5a749721f19e01d/compiler/rustc_middle/src/ty/typeck_results.rs:617:13:
Box<dyn Any>
stack backtrace:
   0:     0x77a14e111113 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h46626ed9cd3e56f7
   1:     0x77a14e802ff7 - core::fmt::write::h4d2e5b237511068d
   2:     0x77a14e106c43 - std::io::Write::write_fmt::h0a6d08649f6b4794
   3:     0x77a14e110f72 - std::sys::backtrace::BacktraceLock::print::h5062aa0b611b50d5
   4:     0x77a14e114b5a - std::panicking::default_hook::{{closure}}::h0e15a59178351623
   5:     0x77a14e1146df - std::panicking::default_hook::h3ec2990fcc64ffed
   6:     0x77a14d203093 - std[808e806d5b2b7162]::panicking::update_hook::<alloc[ab15aa01d122754d]::boxed::Box<rustc_driver_impl[65ab2425e8009d2a]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x77a14e1153c3 - std::panicking::rust_panic_with_hook::h81cd226d4be5cbf8
   8:     0x77a14d240701 - std[808e806d5b2b7162]::panicking::begin_panic::<rustc_errors[62cc3ed152ddb7e4]::ExplicitBug>::{closure#0}
   9:     0x77a14d234d46 - std[808e806d5b2b7162]::sys::backtrace::__rust_end_short_backtrace::<std[808e806d5b2b7162]::panicking::begin_panic<rustc_errors[62cc3ed152ddb7e4]::ExplicitBug>::{closure#0}, !>
  10:     0x77a14d234b23 - std[808e806d5b2b7162]::panicking::begin_panic::<rustc_errors[62cc3ed152ddb7e4]::ExplicitBug>
  11:     0x77a14d24a141 - <rustc_errors[62cc3ed152ddb7e4]::diagnostic::BugAbort as rustc_errors[62cc3ed152ddb7e4]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x77a14d80ea3a - rustc_middle[54c0bfeda72395ed]::util::bug::opt_span_bug_fmt::<rustc_span[a83c2a3226fb7137]::span_encoding::Span>::{closure#0}
  13:     0x77a14d7ee51a - rustc_middle[54c0bfeda72395ed]::ty::context::tls::with_opt::<rustc_middle[54c0bfeda72395ed]::util::bug::opt_span_bug_fmt<rustc_span[a83c2a3226fb7137]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x77a14d7ee38b - rustc_middle[54c0bfeda72395ed]::ty::context::tls::with_context_opt::<rustc_middle[54c0bfeda72395ed]::ty::context::tls::with_opt<rustc_middle[54c0bfeda72395ed]::util::bug::opt_span_bug_fmt<rustc_span[a83c2a3226fb7137]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x77a14a8976f0 - rustc_middle[54c0bfeda72395ed]::util::bug::bug_fmt
  16:     0x77a14f24a572 - rustc_mir_build[27ba85c1db70c283]::thir::cx::thir_body
  17:     0x77a14f2489e0 - rustc_query_impl[86f3072600f97609]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[86f3072600f97609]::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 16usize]>>
  18:     0x77a14f234c82 - rustc_query_system[d6ca0e24d754464]::query::plumbing::try_execute_query::<rustc_query_impl[86f3072600f97609]::DynamicConfig<rustc_data_structures[17a0ca3b0fe088c]::vec_cache::VecCache<rustc_span[a83c2a3226fb7137]::def_id::LocalDefId, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[d6ca0e24d754464]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[86f3072600f97609]::plumbing::QueryCtxt, false>
  19:     0x77a14f2348cc - rustc_query_impl[86f3072600f97609]::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
  20:     0x77a14ecbf16b - rustc_mir_build[27ba85c1db70c283]::thir::pattern::check_match::check_match
  21:     0x77a14ecbe48f - rustc_query_impl[86f3072600f97609]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[86f3072600f97609]::query_impl::check_match::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 1usize]>>
  22:     0x77a14efc6139 - rustc_query_system[d6ca0e24d754464]::query::plumbing::try_execute_query::<rustc_query_impl[86f3072600f97609]::DynamicConfig<rustc_data_structures[17a0ca3b0fe088c]::vec_cache::VecCache<rustc_span[a83c2a3226fb7137]::def_id::LocalDefId, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[d6ca0e24d754464]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[86f3072600f97609]::plumbing::QueryCtxt, false>
  23:     0x77a14efc5d7d - rustc_query_impl[86f3072600f97609]::query_impl::check_match::get_query_non_incr::__rust_end_short_backtrace
  24:     0x77a14ed457df - rustc_mir_build[27ba85c1db70c283]::builder::build_mir
  25:     0x77a14e8087f5 - rustc_mir_transform[47b06709e801ddd3]::mir_built
  26:     0x77a14e8087c7 - rustc_query_impl[86f3072600f97609]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[86f3072600f97609]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 8usize]>>
  27:     0x77a14ea1aeee - rustc_query_system[d6ca0e24d754464]::query::plumbing::try_execute_query::<rustc_query_impl[86f3072600f97609]::DynamicConfig<rustc_data_structures[17a0ca3b0fe088c]::vec_cache::VecCache<rustc_span[a83c2a3226fb7137]::def_id::LocalDefId, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[d6ca0e24d754464]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[86f3072600f97609]::plumbing::QueryCtxt, false>
  28:     0x77a14ea1aa09 - rustc_query_impl[86f3072600f97609]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  29:     0x77a14e8261b8 - rustc_mir_transform[47b06709e801ddd3]::ffi_unwind_calls::has_ffi_unwind_calls
  30:     0x77a14e825bb7 - rustc_query_impl[86f3072600f97609]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[86f3072600f97609]::query_impl::has_ffi_unwind_calls::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 1usize]>>
  31:     0x77a14efc6139 - rustc_query_system[d6ca0e24d754464]::query::plumbing::try_execute_query::<rustc_query_impl[86f3072600f97609]::DynamicConfig<rustc_data_structures[17a0ca3b0fe088c]::vec_cache::VecCache<rustc_span[a83c2a3226fb7137]::def_id::LocalDefId, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[d6ca0e24d754464]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[86f3072600f97609]::plumbing::QueryCtxt, false>
  32:     0x77a14efc5e11 - rustc_query_impl[86f3072600f97609]::query_impl::has_ffi_unwind_calls::get_query_non_incr::__rust_end_short_backtrace
  33:     0x77a14ea19894 - <rustc_middle[54c0bfeda72395ed]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[bb24fe0bfe452ad9]::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0}
  34:     0x77a14ea17168 - rustc_interface[bb24fe0bfe452ad9]::passes::analysis
  35:     0x77a14ea16633 - rustc_query_impl[86f3072600f97609]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[86f3072600f97609]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 0usize]>>
  36:     0x77a14f86250e - rustc_query_system[d6ca0e24d754464]::query::plumbing::try_execute_query::<rustc_query_impl[86f3072600f97609]::DynamicConfig<rustc_query_system[d6ca0e24d754464]::query::caches::SingleCache<rustc_middle[54c0bfeda72395ed]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[86f3072600f97609]::plumbing::QueryCtxt, false>
  37:     0x77a14f862202 - rustc_query_impl[86f3072600f97609]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  38:     0x77a14fb594d9 - rustc_interface[bb24fe0bfe452ad9]::passes::create_and_enter_global_ctxt::<core[63e14f5addbcdb87]::option::Option<rustc_interface[bb24fe0bfe452ad9]::queries::Linker>, rustc_driver_impl[65ab2425e8009d2a]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  39:     0x77a14fb4a849 - rustc_interface[bb24fe0bfe452ad9]::interface::run_compiler::<(), rustc_driver_impl[65ab2425e8009d2a]::run_compiler::{closure#0}>::{closure#1}
  40:     0x77a14fa18bf2 - std[808e806d5b2b7162]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[bb24fe0bfe452ad9]::util::run_in_thread_with_globals<rustc_interface[bb24fe0bfe452ad9]::util::run_in_thread_pool_with_globals<rustc_interface[bb24fe0bfe452ad9]::interface::run_compiler<(), rustc_driver_impl[65ab2425e8009d2a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  41:     0x77a14fa188e4 - <<std[808e806d5b2b7162]::thread::Builder>::spawn_unchecked_<rustc_interface[bb24fe0bfe452ad9]::util::run_in_thread_with_globals<rustc_interface[bb24fe0bfe452ad9]::util::run_in_thread_pool_with_globals<rustc_interface[bb24fe0bfe452ad9]::interface::run_compiler<(), rustc_driver_impl[65ab2425e8009d2a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[63e14f5addbcdb87]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x77a14fa16efd - std::sys::pal::unix::thread::Thread::new::thread_start::hea2dda47b7cb7070
  43:     0x77a1494a57eb - <unknown>
  44:     0x77a14952918c - <unknown>
  45:                0x0 - <unknown>

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: please make sure that you have updated to the latest nightly

note: rustc 1.89.0-nightly (32b51523f 2025-06-15) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [thir_body] building THIR for `main::{closure#0}`
#1 [check_match] match-checking `main::{closure#0}`
#2 [mir_built] building MIR for `main::{closure#0}`
#3 [has_ffi_unwind_calls] checking if `main::{closure#0}` contains FFI-unwind calls
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 7 previous errors

Some errors have detailed explanations: E0308, E0422.
For more information about an error, try `rustc --explain E0308`.

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jun 15, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 15, 2025
@matthiaskrgr
Copy link
Member Author

smaller

use std::arch::x86_64::_mm_blend_ps;
fn main() {
    _mm_blend_ps(0_usize, 2, Exhibit { factory: |_| 0 })
}

bisects to nightly-2024-02-09

  commit[0] 2024-02-07: Auto merge of #120748 - Nadrieril:rollup-dj0qwv5, r=Nadrieril
  commit[1] 2024-02-08: Auto merge of #120381 - fee1-dead-contrib:reconstify-add, r=compiler-errors
  commit[2] 2024-02-08: Auto merge of #120521 - reitermarkus:generic-nonzero-constructors, r=dtolnay
  commit[3] 2024-02-08: Auto merge of #120558 - oli-obk:missing_impl_item_ice, r=estebank
  commit[4] 2024-02-08: Auto merge of #120579 - GuillaumeGomez:prevent-running-unneeded-code, r=notriddle
  commit[5] 2024-02-08: Auto merge of #120550 - oli-obk:track_errors8, r=estebank
  commit[6] 2024-02-08: Auto merge of #120767 - matthiaskrgr:rollup-0k8ib1c, r=matthiaskrgr
  commit[7] 2024-02-08: Auto merge of #120544 - BoxyUwU:enter_forall, r=lcnr
  commit[8] 2024-02-08: Auto merge of #120807 - matthiaskrgr:rollup-1pf3glu, r=matthiaskrgr

@lolbinarycat lolbinarycat added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jun 15, 2025
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 15, 2025
@compiler-errors compiler-errors self-assigned this Jun 16, 2025
@jieyouxu jieyouxu removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 17, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 17, 2025
…lds, r=jieyouxu

Make sure to propagate result from `visit_expr_fields`

We weren't propagating the `ControlFlow::Break` out of a struct field, which means that the solution implemented in rust-lang#130443 didn't work for nested fields.

Fixes rust-lang#142525.
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 17, 2025
…lds, r=jieyouxu

Make sure to propagate result from `visit_expr_fields`

We weren't propagating the `ControlFlow::Break` out of a struct field, which means that the solution implemented in rust-lang#130443 didn't work for nested fields.

Fixes rust-lang#142525.
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 17, 2025
…lds, r=jieyouxu

Make sure to propagate result from `visit_expr_fields`

We weren't propagating the `ControlFlow::Break` out of a struct field, which means that the solution implemented in rust-lang#130443 didn't work for nested fields.

Fixes rust-lang#142525.
rust-timer added a commit that referenced this issue Jun 17, 2025
Rollup merge of #142587 - compiler-errors:try-visit-expr-fields, r=jieyouxu

Make sure to propagate result from `visit_expr_fields`

We weren't propagating the `ControlFlow::Break` out of a struct field, which means that the solution implemented in #130443 didn't work for nested fields.

Fixes #142525.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants