Skip to content
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

ICE: Found unstable fingerprints for evaluate_obligation(4742c1b409da674c-2b2e292cfb3cefd9): Ok(EvaluatedToOk) #138209

Open
1xX69 opened this issue Mar 8, 2025 · 4 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@1xX69
Copy link

1xX69 commented Mar 8, 2025

Code

[package]
name = "rustc-bug1"
version = "0.1.0"
edition = "2024"

[dependencies]
bitcode = { version = "0.6.5", default-features = false, features = [
  "derive",
  "std",
] }
use bitcode::{Encode, Decode};

#[derive(Encode, Decode)]
pub struct HelpLink<'a> {
    link: &'a str,
}

/// Enum representing different types of error details.
#[derive(Encode, Decode)]
pub enum ErrorDetail<'a> {
    Help {
        links: Vec<HelpLink<'a>>,
    },

    LocalizedMessage {
        locale: &'a str,  // line 16
        message: &'a str,
    },
}

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (8c392966a 2025-03-01)
binary: rustc
commit-hash: 8c392966a013fd8a09e6b78b3c8d6e442bc278e1
commit-date: 2025-03-01
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output

Backtrace

user@work1:~/workspace/rustc-bug1$ cargo build
   Compiling proc-macro2 v1.0.94
   Compiling unicode-ident v1.0.18
   Compiling bytemuck v1.22.0
   Compiling quote v1.0.39
   Compiling syn v2.0.99
   Compiling bitcode_derive v0.6.5
   Compiling bitcode v0.6.5
   Compiling rustc-bug1 v0.1.0 (/home/user/workspace/rustc-bug1)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.21s
user@work1:~/workspace/rustc-bug1$ cat src/lib.rs
use bitcode::{Encode, Decode};

#[derive(Encode, Decode)]
pub struct HelpLink<'a> {
    link: &'a str,
}

/// Enum representing different types of error details.
#[derive(Encode, Decode)]
pub enum ErrorDetail<'a> {
    Help {
        links: Vec<HelpLink<'a>>,
    },

    LocalizedMessage {
        locale: &'a str,  // line 16
        message: &'a str,
    },
}
user@work1:~/workspace/rustc-bug1$ sed -i '16d' src/lib.rs
user@work1:~/workspace/rustc-bug1$ RUST_BACKTRACE=full cargo build
   Compiling rustc-bug1 v0.1.0 (/home/user/workspace/rustc-bug1)
error: internal compiler error: encountered incremental compilation error with evaluate_obligation(4742c1b409da674c-2b2e292cfb3cefd9)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p rustc_bug1` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information


thread 'rustc' panicked at /rustc/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_query_system/src/query/plumbing.rs:731:9:
Found unstable fingerprints for evaluate_obligation(4742c1b409da674c-2b2e292cfb3cefd9): Ok(EvaluatedToOk)
stack backtrace:
   0:     0x77a7b5dbedf4 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdbd106d724e72c20
   1:     0x77a7b66057e2 - core::fmt::write::h861eecc74abebf7a
   2:     0x77a7b764dd51 - std::io::Write::write_fmt::h493b3152b071fba0
   3:     0x77a7b5dbec52 - std::sys::backtrace::BacktraceLock::print::h71f315c25fc266cb
   4:     0x77a7b5dc1532 - std::panicking::default_hook::{{closure}}::h8019dc6a2c6c0fe7
   5:     0x77a7b5dc1124 - std::panicking::default_hook::h497f769686a88dd6
   6:     0x77a7b4f18417 - std[e7ccd300aecc5933]::panicking::update_hook::<alloc[8cc49891b291256f]::boxed::Box<rustc_driver_impl[b622dd38a520489a]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x77a7b5dc1da3 - std::panicking::rust_panic_with_hook::h98fc165e90ef379e
   8:     0x77a7b5dc1a9a - std::panicking::begin_panic_handler::{{closure}}::h2c1a60d0a908eaec
   9:     0x77a7b5dbf2c9 - std::sys::backtrace::__rust_end_short_backtrace::he8aba8f9b7ddf304
  10:     0x77a7b5dc175d - rust_begin_unwind
  11:     0x77a7b2a5a680 - core::panicking::panic_fmt::hcbf39f8c1e585f84
  12:     0x77a7b54b4a63 - rustc_query_system[18aefac76bbd956a]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt>
  13:     0x77a7b6e06018 - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::DefaultCache<rustc_type_ir[62a9722b2d8d5cac]::canonical::CanonicalQueryInput<rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt, rustc_middle[464f7c4b782fc90]::ty::ParamEnvAnd<rustc_middle[464f7c4b782fc90]::ty::predicate::Predicate>>, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  14:     0x77a7b6af1dc5 - rustc_query_impl[f11a5069a0fc322c]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  15:     0x77a7b6e9bb11 - <rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillProcessor as rustc_data_structures[fa39f8fcd9225f43]::obligation_forest::ObligationProcessor>::process_obligation
  16:     0x77a7b6607529 - <rustc_data_structures[fa39f8fcd9225f43]::obligation_forest::ObligationForest<rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillProcessor>
  17:     0x77a7b6a58387 - <rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillmentContext<rustc_trait_selection[4edfcc70fd15c568]::traits::FulfillmentError> as rustc_infer[c858f4b860ba366e]::traits::engine::TraitEngine<rustc_trait_selection[4edfcc70fd15c568]::traits::FulfillmentError>>::select_all_or_error
  18:     0x77a7b6d8a78f - rustc_hir_analysis[6dcb172f42838441]::check::compare_impl_item::check_type_bounds
  19:     0x77a7b6d9cd62 - rustc_hir_analysis[6dcb172f42838441]::check::compare_impl_item::compare_impl_item
  20:     0x77a7b6d9af47 - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::compare_impl_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>>
  21:     0x77a7b6aeccaa - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  22:     0x77a7b6af10b6 - rustc_query_impl[f11a5069a0fc322c]::query_impl::compare_impl_item::get_query_incr::__rust_end_short_backtrace
  23:     0x77a7b6e2690c - rustc_hir_analysis[6dcb172f42838441]::check::check::check_item_type
  24:     0x77a7b6db6d66 - rustc_hir_analysis[6dcb172f42838441]::check::wfcheck::check_well_formed
  25:     0x77a7b6db544d - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>>
  26:     0x77a7b6aed061 - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  27:     0x77a7b7693c94 - rustc_query_impl[f11a5069a0fc322c]::plumbing::force_from_dep_node::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>>
  28:     0x77a7b7693aed - <rustc_query_impl[f11a5069a0fc322c]::plumbing::query_callback<rustc_query_impl[f11a5069a0fc322c]::query_impl::check_well_formed::QueryType>::{closure#0} as core[9e5e7b8b77114b88]::ops::function::FnOnce<(rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt, rustc_query_system[18aefac76bbd956a]::dep_graph::dep_node::DepNode)>>::call_once
  29:     0x77a7b66258ba - <rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepGraphData<rustc_middle[464f7c4b782fc90]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  30:     0x77a7b6624fee - <rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepGraphData<rustc_middle[464f7c4b782fc90]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  31:     0x77a7b708fcbf - rustc_query_system[18aefac76bbd956a]::query::plumbing::ensure_must_run::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::DefaultCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalModDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  32:     0x77a7b759ac13 - rustc_query_impl[f11a5069a0fc322c]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  33:     0x77a7b6b5e60f - rustc_hir_analysis[6dcb172f42838441]::check_crate
  34:     0x77a7b6b5831c - rustc_interface[f15b12210e2206a6]::passes::run_required_analyses
  35:     0x77a7b7649cfa - rustc_interface[f15b12210e2206a6]::passes::analysis
  36:     0x77a7b7649cd9 - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>
  37:     0x77a7b76455aa - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::SingleCache<rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  38:     0x77a7b7644fa2 - rustc_query_impl[f11a5069a0fc322c]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  39:     0x77a7b7738b3d - rustc_interface[f15b12210e2206a6]::passes::create_and_enter_global_ctxt::<core[9e5e7b8b77114b88]::option::Option<rustc_interface[f15b12210e2206a6]::queries::Linker>, rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  40:     0x77a7b7703a20 - rustc_interface[f15b12210e2206a6]::interface::run_compiler::<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}
  41:     0x77a7b7559bc8 - std[e7ccd300aecc5933]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f15b12210e2206a6]::util::run_in_thread_with_globals<rustc_interface[f15b12210e2206a6]::util::run_in_thread_pool_with_globals<rustc_interface[f15b12210e2206a6]::interface::run_compiler<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  42:     0x77a7b755a4b4 - <<std[e7ccd300aecc5933]::thread::Builder>::spawn_unchecked_<rustc_interface[f15b12210e2206a6]::util::run_in_thread_with_globals<rustc_interface[f15b12210e2206a6]::util::run_in_thread_pool_with_globals<rustc_interface[f15b12210e2206a6]::interface::run_compiler<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9e5e7b8b77114b88]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x77a7b755b8ab - std::sys::pal::unix::thread::Thread::new::thread_start::h20288ab9ea215a81
  44:     0x77a7b1698af3 - start_thread
  45:     0x77a7b1717f4c - __GI___clone3
  46:                0x0 - <unknown>

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

note: please attach the file at `/home/user/workspace/rustc-bug1/rustc-ice-2025-03-08T06_34_07-266476.txt` to your bug report

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 [evaluate_obligation] evaluating trait selection obligation `_::HelpLinkEncoder: core::marker::Sync`  |  = note: this failure-note originates in the derive macro `Encode` (in Nightly builds, run with -Z macro-backtrace for more info)

#1 [compare_impl_item] checking assoc item `_::<impl at src/lib.rs:9:10: 9:16>::Encoder` is compatible with trait definition
#2 [check_well_formed] checking that `_::<impl at src/lib.rs:9:10: 9:16>` is well-formed
#3 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 check_mod_type_wf(rustc_bug1[c039])
end of try_mark_green dep node stack
error: could not compile `rustc-bug1` (lib) due to 1 previous error

rustc-ice-2025-03-08T06_34_07-266476.txt

thread 'rustc' panicked at /rustc/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_query_system/src/query/plumbing.rs:731:9:
Found unstable fingerprints for evaluate_obligation(4742c1b409da674c-2b2e292cfb3cefd9): Ok(EvaluatedToOk)
stack backtrace:
   0:     0x77a7b7a1b4a5 - std::backtrace::Backtrace::create::h4caae72ea1d639e2
   1:     0x77a7b5da9495 - std::backtrace::Backtrace::force_capture::hed7edc9d6077f7f2
   2:     0x77a7b4f18b5e - std[e7ccd300aecc5933]::panicking::update_hook::<alloc[8cc49891b291256f]::boxed::Box<rustc_driver_impl[b622dd38a520489a]::install_ice_hook::{closure#1}>>::{closure#0}
   3:     0x77a7b5dc1da3 - std::panicking::rust_panic_with_hook::h98fc165e90ef379e
   4:     0x77a7b5dc1a9a - std::panicking::begin_panic_handler::{{closure}}::h2c1a60d0a908eaec
   5:     0x77a7b5dbf2c9 - std::sys::backtrace::__rust_end_short_backtrace::he8aba8f9b7ddf304
   6:     0x77a7b5dc175d - rust_begin_unwind
   7:     0x77a7b2a5a680 - core::panicking::panic_fmt::hcbf39f8c1e585f84
   8:     0x77a7b54b4a63 - rustc_query_system[18aefac76bbd956a]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt>
   9:     0x77a7b6e06018 - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::DefaultCache<rustc_type_ir[62a9722b2d8d5cac]::canonical::CanonicalQueryInput<rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt, rustc_middle[464f7c4b782fc90]::ty::ParamEnvAnd<rustc_middle[464f7c4b782fc90]::ty::predicate::Predicate>>, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  10:     0x77a7b6af1dc5 - rustc_query_impl[f11a5069a0fc322c]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  11:     0x77a7b6e9bb11 - <rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillProcessor as rustc_data_structures[fa39f8fcd9225f43]::obligation_forest::ObligationProcessor>::process_obligation
  12:     0x77a7b6607529 - <rustc_data_structures[fa39f8fcd9225f43]::obligation_forest::ObligationForest<rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillProcessor>
  13:     0x77a7b6a58387 - <rustc_trait_selection[4edfcc70fd15c568]::traits::fulfill::FulfillmentContext<rustc_trait_selection[4edfcc70fd15c568]::traits::FulfillmentError> as rustc_infer[c858f4b860ba366e]::traits::engine::TraitEngine<rustc_trait_selection[4edfcc70fd15c568]::traits::FulfillmentError>>::select_all_or_error
  14:     0x77a7b6d8a78f - rustc_hir_analysis[6dcb172f42838441]::check::compare_impl_item::check_type_bounds
  15:     0x77a7b6d9cd62 - rustc_hir_analysis[6dcb172f42838441]::check::compare_impl_item::compare_impl_item
  16:     0x77a7b6d9af47 - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::compare_impl_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>>
  17:     0x77a7b6aeccaa - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  18:     0x77a7b6af10b6 - rustc_query_impl[f11a5069a0fc322c]::query_impl::compare_impl_item::get_query_incr::__rust_end_short_backtrace
  19:     0x77a7b6e2690c - rustc_hir_analysis[6dcb172f42838441]::check::check::check_item_type
  20:     0x77a7b6db6d66 - rustc_hir_analysis[6dcb172f42838441]::check::wfcheck::check_well_formed
  21:     0x77a7b6db544d - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>>
  22:     0x77a7b6aed061 - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  23:     0x77a7b7693c94 - rustc_query_impl[f11a5069a0fc322c]::plumbing::force_from_dep_node::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_data_structures[fa39f8fcd9225f43]::vec_cache::VecCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepNodeIndex>, false, false, false>>
  24:     0x77a7b7693aed - <rustc_query_impl[f11a5069a0fc322c]::plumbing::query_callback<rustc_query_impl[f11a5069a0fc322c]::query_impl::check_well_formed::QueryType>::{closure#0} as core[9e5e7b8b77114b88]::ops::function::FnOnce<(rustc_middle[464f7c4b782fc90]::ty::context::TyCtxt, rustc_query_system[18aefac76bbd956a]::dep_graph::dep_node::DepNode)>>::call_once
  25:     0x77a7b66258ba - <rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepGraphData<rustc_middle[464f7c4b782fc90]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  26:     0x77a7b6624fee - <rustc_query_system[18aefac76bbd956a]::dep_graph::graph::DepGraphData<rustc_middle[464f7c4b782fc90]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  27:     0x77a7b708fcbf - rustc_query_system[18aefac76bbd956a]::query::plumbing::ensure_must_run::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::DefaultCache<rustc_span[eeaf0b3b2812840a]::def_id::LocalModDefId, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt>
  28:     0x77a7b759ac13 - rustc_query_impl[f11a5069a0fc322c]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  29:     0x77a7b6b5e60f - rustc_hir_analysis[6dcb172f42838441]::check_crate
  30:     0x77a7b6b5831c - rustc_interface[f15b12210e2206a6]::passes::run_required_analyses
  31:     0x77a7b7649cfa - rustc_interface[f15b12210e2206a6]::passes::analysis
  32:     0x77a7b7649cd9 - rustc_query_impl[f11a5069a0fc322c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f11a5069a0fc322c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>
  33:     0x77a7b76455aa - rustc_query_system[18aefac76bbd956a]::query::plumbing::try_execute_query::<rustc_query_impl[f11a5069a0fc322c]::DynamicConfig<rustc_query_system[18aefac76bbd956a]::query::caches::SingleCache<rustc_middle[464f7c4b782fc90]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f11a5069a0fc322c]::plumbing::QueryCtxt, true>
  34:     0x77a7b7644fa2 - rustc_query_impl[f11a5069a0fc322c]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  35:     0x77a7b7738b3d - rustc_interface[f15b12210e2206a6]::passes::create_and_enter_global_ctxt::<core[9e5e7b8b77114b88]::option::Option<rustc_interface[f15b12210e2206a6]::queries::Linker>, rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  36:     0x77a7b7703a20 - rustc_interface[f15b12210e2206a6]::interface::run_compiler::<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}
  37:     0x77a7b7559bc8 - std[e7ccd300aecc5933]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f15b12210e2206a6]::util::run_in_thread_with_globals<rustc_interface[f15b12210e2206a6]::util::run_in_thread_pool_with_globals<rustc_interface[f15b12210e2206a6]::interface::run_compiler<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  38:     0x77a7b755a4b4 - <<std[e7ccd300aecc5933]::thread::Builder>::spawn_unchecked_<rustc_interface[f15b12210e2206a6]::util::run_in_thread_with_globals<rustc_interface[f15b12210e2206a6]::util::run_in_thread_pool_with_globals<rustc_interface[f15b12210e2206a6]::interface::run_compiler<(), rustc_driver_impl[b622dd38a520489a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9e5e7b8b77114b88]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x77a7b755b8ab - std::sys::pal::unix::thread::Thread::new::thread_start::h20288ab9ea215a81
  40:     0x77a7b1698af3 - start_thread
  41:     0x77a7b1717f4c - __GI___clone3
  42:                0x0 - <unknown>


rustc version: 1.87.0-nightly (8c392966a 2025-03-01)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `_::HelpLinkEncoder: core::marker::Sync`
#1 [compare_impl_item] checking assoc item `_::<impl at src/lib.rs:9:10: 9:16>::Encoder` is compatible with trait definition
#2 [check_well_formed] checking that `_::<impl at src/lib.rs:9:10: 9:16>` is well-formed
#3 [analysis] running analysis passes on this crate
end of query stack

Context

This bug is kinda tricky. Follow the instructions below to reproduce the issue:

  1. Run cargo build. Should report success.
  2. Remove line 16 from src/lib.rs.
  3. Run cargo build once again. Should fail.

Related: matteopolak/axum-codec#10

@1xX69 1xX69 added C-bug Category: This is a bug. 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. labels Mar 8, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 8, 2025
@jieyouxu jieyouxu changed the title Rusty enums have gone rogue! ICE: Found unstable fingerprints for evaluate_obligation(4742c1b409da674c-2b2e292cfb3cefd9): Ok(EvaluatedToOk) Mar 8, 2025
@jieyouxu jieyouxu added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Mar 8, 2025
@lqd
Copy link
Member

lqd commented Mar 8, 2025

An incremental bug with steps to reproduce omg thanks so much!

@lqd lqd added the A-incr-comp Area: Incremental compilation label Mar 8, 2025
@lqd
Copy link
Member

lqd commented Mar 8, 2025

edit: scratch that, proc-macro2's nightly detection broke my bisection.

@rustbot label +E-needs-bisection

@rustbot rustbot added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Mar 8, 2025
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 8, 2025
@cyrgani
Copy link
Contributor

cyrgani commented Mar 8, 2025

reduction:

pub trait Encoder<T>: Send {}

pub trait Encode {
    type Encoder;
}

impl Encode for &str {
    type Encoder = StrEncoder;
}
pub struct StrEncoder;

pub struct HelpLink {}

pub struct HelpLinkEncoder {
    link: <&'static str as Encode>::Encoder,
}
impl Encoder<HelpLink> for HelpLinkEncoder {}

pub struct ErrorDetail {
    /* START_REMOVE */ locale: u8,
    /* END_REMOVE */
}
pub struct ErrorDetailEncoder {
    a: HelpLinkEncoder,
    b: <&'static str as Encode>::Encoder,
}
impl Encoder<ErrorDetail> for ErrorDetailEncoder {}

reproduce by cargo clean, cargo build, removing the marked locale: u8 field and rerunning cargo build

@rustbot label S-has-mcve -E-needs-mcve

@rustbot rustbot added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Mar 8, 2025
@cyrgani
Copy link
Contributor

cyrgani commented Mar 8, 2025

bisection:

searched toolchains nightly-2021-02-10 through nightly-2023-05-31


Regression in nightly-2021-03-14


fetching https://static.rust-lang.org/dist/2021-03-13/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2021-03-13: 40 B / 40 B [=====================================================================================================================] 100.00 % 428.25 KB/s converted 2021-03-13 to b3e19a2
fetching https://static.rust-lang.org/dist/2021-03-14/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2021-03-14: 40 B / 40 B [=====================================================================================================================] 100.00 % 489.75 KB/s converted 2021-03-14 to acca818
looking for regression commit between 2021-03-13 and 2021-03-14
fetching (via remote github) commits from max(b3e19a2, 2021-03-11) to acca818
ending github query because we found starting sha: b3e19a2
get_commits_between returning commits, len: 10
commit[0] 2021-03-12: Auto merge of #83024 - Xanewok:update-rls, r=Dylan-DPC
commit[1] 2021-03-12: Auto merge of #83022 - m-ou-se:mem-replace-no-swap, r=nagisa
commit[2] 2021-03-13: Auto merge of #83067 - JohnTitor:rollup-0wo338i, r=JohnTitor
commit[3] 2021-03-13: Auto merge of #82436 - osa1:issue80258, r=nikomatsakis
commit[4] 2021-03-13: Auto merge of #82760 - WaffleLapkin:unleak_extend_from_within, r=kennytm
commit[5] 2021-03-13: Auto merge of #82878 - sexxi-goose:repr_packed, r=nikomatsakis
commit[6] 2021-03-13: Auto merge of #82891 - cjgillot:monoparent, r=petrochenkov
commit[7] 2021-03-13: Auto merge of #83069 - tgnottingham:simplify-query-cache-iter, r=cjgillot
commit[8] 2021-03-13: Auto merge of #83007 - Aaron1011:incr-verify-default, r=Mark-Simulacrum
commit[9] 2021-03-13: Auto merge of #83064 - cjgillot:fhash, r=jackh726

@rustbot label -E-needs-bisection S-has-bisection

@rustbot rustbot added S-has-bisection Status: a bisection has been found for this issue and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Mar 8, 2025
@compiler-errors compiler-errors added the fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants