rust-lang / rust-lang/rust

Encountered incremental compilation error with find_field(a5f984281f1e0bb0-ee8ea99685b18732)

Open
#125,678 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-decl-macros-2-0 A-incr-comp A-macros C-bug F-decl_macro I-ICE S-needs-repro T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I cannot share the code, however since I was requested to file the unexpected panic in the compiler, I am attaching the stacktrace. This occurs when I change a bound from:
impl<G: H, T: N<G>> Trait<dyn N<G>> for T where T: 'static
to
impl<G: H, T: N<G> + 'static> Trait<dyn N<G>> for T

Meta and Error Output
thread 'rustc' panicked at /rustc/84b40fc908c3adc7e0e470b3fbaa264df0e122b8/compiler/rustc_query_system/src/query/plumbing.rs:726:9:
Found unstable fingerprints for find_field(a5f984281f1e0bb0-ee8ea99685b18732): None
stack backtrace:
   0:        0x101441038 - std::backtrace::Backtrace::create::h80141d8248a83b53
   1:        0x10acf78b0 - <alloc[719386f0d9f36626]::boxed::Box<rustc_driver_impl[7a60ac4377fdb13f]::install_ice_hook::{closure#0}> as core[d272a70a7efa9590]::ops::function::Fn<(&dyn for<'a, 'b> core[d272a70a7efa9590]::ops::function::Fn<(&'a core[d272a70a7efa9590]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[d272a70a7efa9590]::marker::Send + core[d272a70a7efa9590]::marker::Sync, &core[d272a70a7efa9590]::panic::panic_info::PanicInfo)>>::call
   2:        0x101459db0 - std::panicking::rust_panic_with_hook::h2fd94c4de3d2d4e8
   3:        0x1014597c4 - std::panicking::begin_panic_handler::{{closure}}::hb98cc9edc890a6c2
   4:        0x1014573e8 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e8ff8b1c4ef6435
   5:        0x101459534 - _rust_begin_unwind
   6:        0x1014b52dc - core::panicking::panic_fmt::hbc7689a26665519e
   7:        0x10efec880 - rustc_query_system[86320e985ad85d60]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[a784bbf211e613f7]::ty::context::TyCtxt>.specialized.3
   8:        0x10c00a81c - rustc_query_system[86320e985ad85d60]::query::plumbing::incremental_verify_ich::<rustc_middle[a784bbf211e613f7]::ty::context::TyCtxt, rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 4usize]>>
   9:        0x10bfdf394 - rustc_query_system[86320e985ad85d60]::query::plumbing::try_execute_query::<rustc_query_impl[d631a5f5bfb0b403]::DynamicConfig<rustc_query_system[86320e985ad85d60]::query::caches::DefaultCache<(rustc_span[bf3e504c8b161d65]::def_id::DefId, rustc_span[bf3e504c8b161d65]::symbol::Ident), rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 4usize]>>, false, false, false>, rustc_query_impl[d631a5f5bfb0b403]::plumbing::QueryCtxt, true>
  10:        0x10c10c824 - rustc_query_impl[d631a5f5bfb0b403]::query_impl::find_field::get_query_incr::__rust_end_short_backtrace
  11:        0x10b14dc00 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  12:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  13:        0x10b14d3d8 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  14:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  15:        0x10b14d3d8 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  16:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17:        0x10b14d038 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  18:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19:        0x10b14e294 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  20:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:        0x10b14d3d8 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_kind
  22:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:        0x10b116398 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_block_with_expected
  24:        0x10b0f9bac - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:        0x10b0fa6a4 - <rustc_hir_typeck[6e49abfc25ac21c6]::fn_ctxt::FnCtxt>::check_return_expr
  26:        0x10b1d2350 - rustc_hir_typeck[6e49abfc25ac21c6]::check::check_fn
  27:        0x10b1b690c - rustc_hir_typeck[6e49abfc25ac21c6]::typeck
  28:        0x10c056088 - rustc_query_impl[d631a5f5bfb0b403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d631a5f5bfb0b403]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 8usize]>>
  29:        0x10c09c740 - <rustc_query_impl[d631a5f5bfb0b403]::query_impl::typeck::dynamic_query::{closure#2} as core[d272a70a7efa9590]::ops::function::FnOnce<(rustc_middle[a784bbf211e613f7]::ty::context::TyCtxt, rustc_span[bf3e504c8b161d65]::def_id::LocalDefId)>>::call_once
  30:        0x10bfff5cc - rustc_query_system[86320e985ad85d60]::query::plumbing::try_execute_query::<rustc_query_impl[d631a5f5bfb0b403]::DynamicConfig<rustc_query_system[86320e985ad85d60]::query::caches::VecCache<rustc_span[bf3e504c8b161d65]::def_id::LocalDefId, rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d631a5f5bfb0b403]::plumbing::QueryCtxt, true>
  31:        0x10c135c34 - rustc_query_impl[d631a5f5bfb0b403]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  32:        0x10af3cab0 - <rustc_middle[a784bbf211e613f7]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[2bbc207b2e1cff80]::check_crate::{closure#4}>::{closure#0}
  33:        0x10afa1e64 - <rustc_data_structures[f340f78e6b6d7492]::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures[f340f78e6b6d7492]::sync::parallel::enabled::par_for_each_in<&rustc_span[bf3e504c8b161d65]::def_id::LocalDefId, &[rustc_span[bf3e504c8b161d65]::def_id::LocalDefId], <rustc_middle[a784bbf211e613f7]::hir::map::Map>::par_body_owners<rustc_hir_analysis[2bbc207b2e1cff80]::check_crate::{closure#4}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
  34:        0x10b00fc5c - rustc_hir_analysis[2bbc207b2e1cff80]::check_crate
  35:        0x10b47d788 - rustc_interface[3a0f763c368c80a]::passes::analysis
  36:        0x10c056128 - rustc_query_impl[d631a5f5bfb0b403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d631a5f5bfb0b403]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 1usize]>>
  37:        0x10c1fb674 - <rustc_query_impl[d631a5f5bfb0b403]::query_impl::analysis::dynamic_query::{closure#2} as core[d272a70a7efa9590]::ops::function::FnOnce<(rustc_middle[a784bbf211e613f7]::ty::context::TyCtxt, ())>>::call_once
  38:        0x10bf73d28 - rustc_query_system[86320e985ad85d60]::query::plumbing::try_execute_query::<rustc_query_impl[d631a5f5bfb0b403]::DynamicConfig<rustc_query_system[86320e985ad85d60]::query::caches::SingleCache<rustc_middle[a784bbf211e613f7]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[d631a5f5bfb0b403]::plumbing::QueryCtxt, true>
  39:        0x10c1fe2cc - rustc_query_impl[d631a5f5bfb0b403]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  40:        0x10acff868 - <rustc_middle[a784bbf211e613f7]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}::{closure#1}::{closure#3}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>
  41:        0x10acaa000 - <rustc_interface[3a0f763c368c80a]::interface::Compiler>::enter::<rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}::{closure#1}, core[d272a70a7efa9590]::result::Result<core[d272a70a7efa9590]::option::Option<rustc_interface[3a0f763c368c80a]::queries::Linker>, rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>
  42:        0x10acfe178 - <scoped_tls[c3d37789c751d33]::ScopedKey<rustc_span[bf3e504c8b161d65]::SessionGlobals>>::set::<rustc_interface[3a0f763c368c80a]::util::run_in_thread_with_globals<rustc_interface[3a0f763c368c80a]::util::run_in_thread_pool_with_globals<rustc_interface[3a0f763c368c80a]::interface::run_compiler<core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>, rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}>::{closure#1}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>
  43:        0x10acdc6b8 - rustc_span[bf3e504c8b161d65]::create_session_globals_then::<core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>, rustc_interface[3a0f763c368c80a]::util::run_in_thread_with_globals<rustc_interface[3a0f763c368c80a]::util::run_in_thread_pool_with_globals<rustc_interface[3a0f763c368c80a]::interface::run_compiler<core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>, rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}>::{closure#1}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  44:        0x10ad06ca4 - std[78bc1753afde8562]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3a0f763c368c80a]::util::run_in_thread_with_globals<rustc_interface[3a0f763c368c80a]::util::run_in_thread_pool_with_globals<rustc_interface[3a0f763c368c80a]::interface::run_compiler<core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>, rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}>::{closure#1}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>
  45:        0x10ad07334 - <<std[78bc1753afde8562]::thread::Builder>::spawn_unchecked_<rustc_interface[3a0f763c368c80a]::util::run_in_thread_with_globals<rustc_interface[3a0f763c368c80a]::util::run_in_thread_pool_with_globals<rustc_interface[3a0f763c368c80a]::interface::run_compiler<core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>, rustc_driver_impl[7a60ac4377fdb13f]::run_compiler::{closure#0}>::{closure#1}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d272a70a7efa9590]::result::Result<(), rustc_span[bf3e504c8b161d65]::ErrorGuaranteed>>::{closure#2} as core[d272a70a7efa9590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:        0x101462708 - std::sys::pal::unix::thread::Thread::new::thread_start::h34a6ef4a24114659
  47:        0x186c2bfa8 - __pthread_joiner_wake


rustc version: 1.80.0-nightly (84b40fc90 2024-05-27)
platform: aarch64-apple-darwin

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported bound change and the panic at compiler/rustc_query_system/src/query/plumbing.rs:726, then trace the find_field call through rustc_hir_typeck as shown in the stack trace. Reproducing the incremental compilation failure without the original code is the first hurdle; done means the compiler no longer panics for an equivalent case and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.