Skip to content

adt_sized_constraint called on non-struct type #135287

Closed

Description

@Dig-Doug

Code

Note: Error is in big private project, I can follow up with a smaller example this weekend.

Sharing a rough outline now of what I think is relevant:

#[derive(Debug, Clone)]
pub enum SourceDocument {
  Document {
    source: SourceDocumentModel,
  },
}

#[async_graphql::Object]
impl SourceDocument {
  async fn version_id(&self) -> Uuid {
    match self {
      SourceDocument::Document { source } => source.version_id.clone(),
    }
  }
}

pub struct SourceDocumentLoader {
  pub pool: ReadDbPool,
}

impl Loader<Uuid> for SourceDocumentLoader {
  type Value = SourceDocument;
  type Error = LoaderError;

  async fn load(&self, keys: &[Uuid]) -> Result<HashMap<Uuid, Self::Value>, Self::Error> {
    // Uses diesel to read from a postgres db
    todo!()
  }
}

#[derive(thiserror::Error, Clone, Debug)]
pub enum LoaderError {
  #[error("Error loading data: {message}")]
  Error { message: String },
}

#[derive(Debug, Clone, Queryable, Selectable, Insertable)]
#[diesel(table_name = crate::schema::source_documents)]
#[diesel(check_for_backend(diesel::pg::Pg))]
#[diesel(primary_key(version_id))]
pub struct SourceDocumentModel {
    pub version_id: Uuid,
}

Code uses async_graphql, diesel, and thiserror.

Meta

rustc --version --verbose:

rustc 1.86.0-nightly (a580b5c37 2025-01-08)
binary: rustc
commit-hash: a580b5c379b4fca50dfe5afc0fc0ce00921e4e00
commit-date: 2025-01-08
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.6

Error output

error: internal compiler error: compiler/rustc_ty_utils/src/ty.rs:93:9: `adt_sized_constraint` called on non-struct type: source_document::SourceDocument

rustc-ice-2025-01-09T13_24_52-67690.txt

Backtrace

thread 'rustc' panicked at compiler/rustc_ty_utils/src/ty.rs:93:9:
Box<dyn Any>
stack backtrace:
   0:     0x75cb7b8e3a7a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hc48a3003e72a1fb5
   1:     0x75cb7c013126 - core::fmt::write::h244b471aa97315bd
   2:     0x75cb7cf22211 - std::io::Write::write_fmt::h63cacec38f2c7922
   3:     0x75cb7b8e38d2 - std::sys::backtrace::BacktraceLock::print::h8e88b30882062ce8
   4:     0x75cb7b8e5e77 - std::panicking::default_hook::{{closure}}::he2b2f35b61e5b6b4
   5:     0x75cb7b8e5c60 - std::panicking::default_hook::h2b9fc43053d2ca15
   6:     0x75cb7aa568a8 - std[c08ade969ea4a026]::panicking::update_hook::<alloc[ecf666bc700c7d64]::boxed::Box<rustc_driver_impl[7ccddf7307cff907]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x75cb7b8e66c3 - std::panicking::rust_panic_with_hook::h1126dbe971a7f919
   8:     0x75cb7aa8ecc1 - std[c08ade969ea4a026]::panicking::begin_panic::<rustc_errors[1eaa06d4a73dafc5]::ExplicitBug>::{closure#0}
   9:     0x75cb7aa83ea6 - std[c08ade969ea4a026]::sys::backtrace::__rust_end_short_backtrace::<std[c08ade969ea4a026]::panicking::begin_panic<rustc_errors[1eaa06d4a73dafc5]::ExplicitBug>::{closure#0}, !>
  10:     0x75cb7aa83c63 - std[c08ade969ea4a026]::panicking::begin_panic::<rustc_errors[1eaa06d4a73dafc5]::ExplicitBug>
  11:     0x75cb7aa98c21 - <rustc_errors[1eaa06d4a73dafc5]::diagnostic::BugAbort as rustc_errors[1eaa06d4a73dafc5]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x75cb7b06db03 - rustc_middle[bc4ae9fc2bf4235a]::util::bug::opt_span_bug_fmt::<rustc_span[cfc513d191a8d813]::span_encoding::Span>::{closure#0}
  13:     0x75cb7b052b1a - rustc_middle[bc4ae9fc2bf4235a]::ty::context::tls::with_opt::<rustc_middle[bc4ae9fc2bf4235a]::util::bug::opt_span_bug_fmt<rustc_span[cfc513d191a8d813]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x75cb7b0529ab - rustc_middle[bc4ae9fc2bf4235a]::ty::context::tls::with_context_opt::<rustc_middle[bc4ae9fc2bf4235a]::ty::context::tls::with_opt<rustc_middle[bc4ae9fc2bf4235a]::util::bug::opt_span_bug_fmt<rustc_span[cfc513d191a8d813]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x75cb791d3d20 - rustc_middle[bc4ae9fc2bf4235a]::util::bug::bug_fmt
  16:     0x75cb7d80725b - rustc_ty_utils[677f1c67437d8f87]::ty::adt_sized_constraint.cold
  17:     0x75cb7c63787b - rustc_query_impl[9bbd9b92042adb73]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9bbd9b92042adb73]::query_impl::adt_sized_constraint::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>
  18:     0x75cb7c49f571 - rustc_query_system[7c1448542a492b7f]::query::plumbing::try_execute_query::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefIdCache<rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt, true>
  19:     0x75cb7ce3b807 - rustc_query_impl[9bbd9b92042adb73]::plumbing::force_from_dep_node::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefIdCache<rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
  20:     0x75cb7b3fc6fd - <rustc_query_impl[9bbd9b92042adb73]::plumbing::query_callback<rustc_query_impl[9bbd9b92042adb73]::query_impl::adt_sized_constraint::QueryType>::{closure#0} as core[6b5cbebef9c0da3b]::ops::function::FnOnce<(rustc_middle[bc4ae9fc2bf4235a]::ty::context::TyCtxt, rustc_query_system[7c1448542a492b7f]::dep_graph::dep_node::DepNode)>>::call_once
  21:     0x75cb7c02d6be - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  22:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  23:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  24:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  25:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  26:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  27:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  28:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  29:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  30:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  31:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  32:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  33:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  34:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  35:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  36:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  37:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  38:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  39:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  40:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  41:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  42:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  43:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  44:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  45:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  46:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  47:     0x75cb7c48ea50 - rustc_query_system[7c1448542a492b7f]::query::plumbing::try_execute_query::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefaultCache<rustc_type_ir[72683c14ceefff53]::canonical::CanonicalQueryInput<rustc_middle[bc4ae9fc2bf4235a]::ty::context::TyCtxt, rustc_middle[bc4ae9fc2bf4235a]::ty::ParamEnvAnd<rustc_middle[bc4ae9fc2bf4235a]::ty::predicate::Predicate>>, rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt, true>
  48:     0x75cb7c49ade1 - rustc_query_impl[9bbd9b92042adb73]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  49:     0x75cb7c9aa9b5 - <rustc_trait_selection[3b93a0d4a4051551]::traits::fulfill::FulfillProcessor as rustc_data_structures[ad275ecca387d218]::obligation_forest::ObligationProcessor>::process_obligation
  50:     0x75cb7c004e4b - <rustc_data_structures[ad275ecca387d218]::obligation_forest::ObligationForest<rustc_trait_selection[3b93a0d4a4051551]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[3b93a0d4a4051551]::traits::fulfill::FulfillProcessor>
  51:     0x75cb7c36abe9 - <rustc_trait_selection[3b93a0d4a4051551]::traits::fulfill::FulfillmentContext<rustc_trait_selection[3b93a0d4a4051551]::traits::FulfillmentError> as rustc_infer[5a45bd38abbfece3]::traits::engine::TraitEngine<rustc_trait_selection[3b93a0d4a4051551]::traits::FulfillmentError>>::select_all_or_error
  52:     0x75cb7ac43d62 - rustc_hir_analysis[f90ae88cc1f43808]::check::compare_impl_item::collect_return_position_impl_trait_in_trait_tys::{closure#0}
  53:     0x75cb7b434a13 - rustc_query_impl[9bbd9b92042adb73]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9bbd9b92042adb73]::query_impl::collect_return_position_impl_trait_in_trait_tys::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>
  54:     0x75cb7c49f571 - rustc_query_system[7c1448542a492b7f]::query::plumbing::try_execute_query::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefIdCache<rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt, true>
  55:     0x75cb7ce3b807 - rustc_query_impl[9bbd9b92042adb73]::plumbing::force_from_dep_node::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefIdCache<rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
  56:     0x75cb7b3fe0cd - <rustc_query_impl[9bbd9b92042adb73]::plumbing::query_callback<rustc_query_impl[9bbd9b92042adb73]::query_impl::collect_return_position_impl_trait_in_trait_tys::QueryType>::{closure#0} as core[6b5cbebef9c0da3b]::ops::function::FnOnce<(rustc_middle[bc4ae9fc2bf4235a]::ty::context::TyCtxt, rustc_query_system[7c1448542a492b7f]::dep_graph::dep_node::DepNode)>>::call_once
  57:     0x75cb7c02d6be - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  58:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  59:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  60:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  61:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  62:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  63:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  64:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  65:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  66:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  67:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  68:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  69:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  70:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  71:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  72:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  73:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  74:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  75:     0x75cb7c02d62a - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  76:     0x75cb7c02cdf4 - <rustc_query_system[7c1448542a492b7f]::dep_graph::graph::DepGraphData<rustc_middle[bc4ae9fc2bf4235a]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  77:     0x75cb7ca8977a - rustc_query_system[7c1448542a492b7f]::query::plumbing::ensure_must_run::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::DefaultCache<rustc_span[cfc513d191a8d813]::def_id::LocalModDefId, rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt>
  78:     0x75cb7cf6b297 - rustc_query_impl[9bbd9b92042adb73]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  79:     0x75cb7c425038 - rustc_hir_analysis[f90ae88cc1f43808]::check_crate
  80:     0x75cb7c2c84e8 - rustc_interface[9ea0a400d5371a28]::passes::run_required_analyses
  81:     0x75cb7cf2609e - rustc_interface[9ea0a400d5371a28]::passes::analysis
  82:     0x75cb7cf2606f - rustc_query_impl[9bbd9b92042adb73]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9bbd9b92042adb73]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 0usize]>>
  83:     0x75cb7cf2b83c - rustc_query_system[7c1448542a492b7f]::query::plumbing::try_execute_query::<rustc_query_impl[9bbd9b92042adb73]::DynamicConfig<rustc_query_system[7c1448542a492b7f]::query::caches::SingleCache<rustc_middle[bc4ae9fc2bf4235a]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9bbd9b92042adb73]::plumbing::QueryCtxt, true>
  84:     0x75cb7cf2b095 - rustc_query_impl[9bbd9b92042adb73]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  85:     0x75cb7cf5885e - rustc_interface[9ea0a400d5371a28]::passes::create_and_enter_global_ctxt::<core[6b5cbebef9c0da3b]::option::Option<rustc_interface[9ea0a400d5371a28]::queries::Linker>, rustc_driver_impl[7ccddf7307cff907]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  86:     0x75cb7cfcba64 - rustc_interface[9ea0a400d5371a28]::interface::run_compiler::<(), rustc_driver_impl[7ccddf7307cff907]::run_compiler::{closure#0}>::{closure#1}
  87:     0x75cb7ce2d651 - std[c08ade969ea4a026]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[9ea0a400d5371a28]::util::run_in_thread_with_globals<rustc_interface[9ea0a400d5371a28]::util::run_in_thread_pool_with_globals<rustc_interface[9ea0a400d5371a28]::interface::run_compiler<(), rustc_driver_impl[7ccddf7307cff907]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  88:     0x75cb7ce2db08 - <<std[c08ade969ea4a026]::thread::Builder>::spawn_unchecked_<rustc_interface[9ea0a400d5371a28]::util::run_in_thread_with_globals<rustc_interface[9ea0a400d5371a28]::util::run_in_thread_pool_with_globals<rustc_interface[9ea0a400d5371a28]::interface::run_compiler<(), rustc_driver_impl[7ccddf7307cff907]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6b5cbebef9c0da3b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  89:     0x75cb7ce2f0af - std::sys::pal::unix::thread::Thread::new::thread_start::h2f2b51e924b57f78
  90:     0x75cb7709ca94 - start_thread
                               at ./nptl/pthread_create.c:447:8
  91:     0x75cb77129c3c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  92:                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: please attach the file at `/home/doug/Development/lobbying/rustc-ice-2025-01-09T13_24_52-67690.txt` to your bug report

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 [adt_sized_constraint] computing the `Sized` constraint for `source_document::SourceDocument`
#1 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@async_graphql::dataloader::DataLoader<source_document::SourceDocumentLoader>::load_one<uuid::Uuid>::{closure#0}}: core::marker::Send`
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 TraitSelect(c36863bb4250ede5-f0dd5b3545e01e15)
#1 TraitSelect(4c24be15b2d6f3af-b372a1afbf71a4aa)
#2 TraitSelect(69ab8d1745af0068-b0944b0cab84b24)
#3 TraitSelect(c153f366ec878262-f3ae313c38edf5e7)
#4 TraitSelect(2f883a331de2a01c-9238e411f0403744)
#5 TraitSelect(6dca713fc985efa2-af0ad76122c8aa17)
#6 TraitSelect(64cfb3c63d150d75-1e1f5a402c317172)
#7 TraitSelect(f9af3800d44ff3e4-c672ae11c7e73560)
#8 TraitSelect(ef208155b0fe538e-b7da9cf6c85f2cd7)
#9 TraitSelect(4f5d3a840d9726c3-d1e1fb34a4f029c3)
#10 TraitSelect(2432ab797fc17b91-58047adae3b4e49c)
#11 TraitSelect(d77b66b9d9582d06-c5d1b5ac3ba18980)
#12 TraitSelect(9da3316b7c7fe753-e7982e0523071a7d)
#13 TraitSelect(90e7cc615586a753-4fa0d478fe37a4bc)
#14 TraitSelect(e353561ffe759df0-3da4a5ac9199f1ce)
#15 TraitSelect(b0438a1675ccac99-3c282d273a68e797)
#16 TraitSelect(8998c777296d1649-1dfc41a77f09603a)
#17 TraitSelect(f942389db325f641-b8f5c2ca965388ee)
#18 TraitSelect(cbd4e3a9281c1930-4262525b51832562)
#19 TraitSelect(684a1519b66b3e04-c5a996d7ec774d25)
#20 TraitSelect(3783c758b5bcb5ec-6b7963105e2658c4)
#21 TraitSelect(eeaa1c4e693c75e1-f0989f528411392)
#22 TraitSelect(de190a34dd4b679-4bc8f1e5638b02c3)
#23 TraitSelect(439355cf8e13ae6e-27d4890120885cbf)
#24 TraitSelect(4d717f5e53cbbdca-7536b26de4960f8c)
#25 evaluate_obligation(dd25ae4b162e8c5e-adc1b9760f7d6431)
end of try_mark_green dep node stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 type_of(lobbying_server[564e]::node::_#3::{impl#2}::{synthetic#0})
#1 TraitSelect(7731928422ddb96d-f76ce588425f3ba6)
#2 TraitSelect(471ed7e67a5e48b2-58428cd36fa43e7f)
#3 TraitSelect(a712978cb0ce4e44-675a7994a48a9d4)
#4 TraitSelect(7988b5f2f3494ece-fd576515aca27bf0)
#5 TraitSelect(108f37a0d93bb6de-f6e6be7f42115633)
#6 TraitSelect(4fa9c120236ed362-79730a0412cd8a6a)
#7 TraitSelect(e8fdbc73d73f4ba6-a1f4d1bd97cb19b7)
#8 TraitSelect(51e3c72960005881-e2d885b735040628)
#9 TraitSelect(508a4e880caee318-af4ed7ea6ef94577)
#10 TraitSelect(cab73f48aa018ede-7ffa95981727c00c)
#11 TraitSelect(dbf609b2611019a8-87b6693ebc9448d9)
#12 TraitSelect(3f53904974293e5b-2f4101f90ee3494c)
#13 TraitSelect(1ed16fe09dbace5-3b14393e81f122d5)
#14 evaluate_obligation(933304b9bf69f351-ab6b6da8258b8577)
#15 collect_return_position_impl_trait_in_trait_tys(lobbying_server[564e]::{impl#3}::resolve_field)
#16 type_of(lobbying_server[564e]::{impl#3}::{synthetic#0})
#17 check_well_formed(lobbying_server[564e]::{impl#3})
#18 check_mod_type_wf(lobbying_server[564e])
end of try_mark_green dep node stack[rustc-ice-2025-01-09T13_24_52-67690.txt](https://github.com/user-attachments/files/18362124/rustc-ice-2025-01-09T13_24_52-67690.txt)

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 9, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 9, 2025
  3. cyrgani commented on Jan 12, 2025

    @cyrgani
    Contributor

    How to reproduce this error? Right now, ReadDbPool and crate::schema::source_documents are not defined (and I didn't find ReadDbPool in any of the dependencies). Adding your Cargo.toml can also help to get the right versions and features of dependencies.

  4. Dig-Doug commented on Jan 12, 2025

    @Dig-Doug
    Author

    Apologies, I'm having trouble reproducing this issue in my main project despite restoring to the previous state. Nevertheless, I created a small project that includes the things I think are referenced in the backtrace here to illustrate the project structure.

    Notes

    #15 collect_return_position_impl_trait_in_trait_tys(lobbying_server[564e]::{impl#3}::resolve_field)
    #16 type_of(lobbying_server[564e]::{impl#3}::{synthetic#0})
    #17 check_well_formed(lobbying_server[564e]::{impl#3})
    #18 check_mod_type_wf(lobbying_server[564e])
    

    I assume this is processing the Query struct which includes the GetNodeQuery struct.

    #0 type_of(lobbying_server[564e]::node::_#3::{impl#2}::{synthetic#0})
    

    node is the file that contains the GetNodeQuery code.

    #0 [adt_sized_constraint] computing the `Sized` constraint for `source_document::SourceDocument`
    #1 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@async_graphql::dataloader::DataLoader<source_document::SourceDocumentLoader>::load_one<uuid::Uuid>::{closure#0}}: core::marker::Send`
    end of query stack
    

    Inside the node implementation, it accesses the SourceDocumentLoader and calls the load_one fn.

  5. lukas-code commented on Jan 12, 2025

    @lukas-code
    Contributor

    This is a bug in the compiler's incremental compilation engine. To reproduce it you need to run cargo check, change something, and then run cargo check again. Also it should go away after a cargo clean.

    If you manage to retrace the changes that you did to your codebase and actually get this to reproduce that would be very helpful, but without a repro there is not much we can do here.

    (And this ICE can also happen if you somehow got a bit flipped in your incremental files.)

    @rustbot label A-incr-comp S-needs-repro

  6. added
    A-incr-compArea: Incremental compilation
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    on Jan 12, 2025
  7. Dig-Doug commented on Jan 12, 2025

    @Dig-Doug
    Author

    Aha! Thank you for that info, that was the info I needed.

    I am now able to reproduce by going to src/source_document.rs and changing the struct:

    #[derive(Debug, Clone)]
    pub struct SourceDocument {
        source: SourceDocumentModel,
    }

    to

    #[derive(Debug, Clone)]
    pub enum SourceDocument {
        Document { source: SourceDocumentModel },
    }

    I get:

    cargo check
        Checking adt_sized_constraint v0.1.0 (/home/doug/Development/thirdparty/adt_sized_constraint)
    error[E0574]: expected struct, variant or union type, found enum `SourceDocument`
      --> src/source_document.rs:56:21
       |
    56 |                     SourceDocument{ source: row },
       |                     ^^^^^^^^^^^^^^ not a struct, variant or union type
    
    error: internal compiler error: compiler/rustc_ty_utils/src/ty.rs:91:9: `adt_sized_constraint` called on non-struct type: source_document::SourceDocument
    
    thread 'rustc' panicked at compiler/rustc_ty_utils/src/ty.rs:91:9:
    Box<dyn Any>
    stack backtrace:
       0:     0x7c3477d8682a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha4a311b32f6b4ad8
       1:     0x7c34784277e2 - core::fmt::write::h1866771663f62b81
       2:     0x7c3479281d51 - std::io::Write::write_fmt::hb549e7444823135e
       3:     0x7c3477d86682 - std::sys::backtrace::BacktraceLock::print::hddd3a9918ce29aa7
       4:     0x7c3477d88b5a - std::panicking::default_hook::{{closure}}::h791f75256b902d7d
       5:     0x7c3477d889c0 - std::panicking::default_hook::h82cc572fcb0d8cd7
       6:     0x7c3476e14f55 - std[1b49f43dde054edc]::panicking::update_hook::<alloc[f0e0d4128a1437e6]::boxed::Box<rustc_driver_impl[c421ed190efad9be]::install_ice_hook::{closure#0}>>::{closure#0}
       7:     0x7c3477d89238 - std::panicking::rust_panic_with_hook::he21644cc2707f2c4
       8:     0x7c3476e4fa01 - std[1b49f43dde054edc]::panicking::begin_panic::<rustc_errors[fd0d1ab268a7514d]::ExplicitBug>::{closure#0}
       9:     0x7c3476e429c6 - std[1b49f43dde054edc]::sys::backtrace::__rust_end_short_backtrace::<std[1b49f43dde054edc]::panicking::begin_panic<rustc_errors[fd0d1ab268a7514d]::ExplicitBug>::{closure#0}, !>
      10:     0x7c3476e3df99 - std[1b49f43dde054edc]::panicking::begin_panic::<rustc_errors[fd0d1ab268a7514d]::ExplicitBug>
      11:     0x7c3476e59971 - <rustc_errors[fd0d1ab268a7514d]::diagnostic::BugAbort as rustc_errors[fd0d1ab268a7514d]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
      12:     0x7c34774c8913 - rustc_middle[60437f3b60b3af56]::util::bug::opt_span_bug_fmt::<rustc_span[200b27ea0e9a3b9b]::span_encoding::Span>::{closure#0}
      13:     0x7c34774afe8a - rustc_middle[60437f3b60b3af56]::ty::context::tls::with_opt::<rustc_middle[60437f3b60b3af56]::util::bug::opt_span_bug_fmt<rustc_span[200b27ea0e9a3b9b]::span_encoding::Span>::{closure#0}, !>::{closure#0}
      14:     0x7c34774afd1b - rustc_middle[60437f3b60b3af56]::ty::context::tls::with_context_opt::<rustc_middle[60437f3b60b3af56]::ty::context::tls::with_opt<rustc_middle[60437f3b60b3af56]::util::bug::opt_span_bug_fmt<rustc_span[200b27ea0e9a3b9b]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
      15:     0x7c34759e4110 - rustc_middle[60437f3b60b3af56]::util::bug::bug_fmt
      16:     0x7c3479bdaa15 - rustc_ty_utils[1e377ddf6376fe11]::ty::adt_sized_constraint.cold
      17:     0x7c3478a071ad - rustc_query_impl[d10191050d412fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d10191050d412fc]::query_impl::adt_sized_constraint::dynamic_query::{closure#2}::{closure#0}, rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>
      18:     0x7c34787126f0 - rustc_query_system[c1574a252f7419c]::query::plumbing::try_execute_query::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefIdCache<rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt, true>
      19:     0x7c347920ddc7 - rustc_query_impl[d10191050d412fc]::plumbing::force_from_dep_node::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefIdCache<rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
      20:     0x7c347787c05d - <rustc_query_impl[d10191050d412fc]::plumbing::query_callback<rustc_query_impl[d10191050d412fc]::query_impl::adt_sized_constraint::QueryType>::{closure#0} as core[9e3ec3a99e20741e]::ops::function::FnOnce<(rustc_middle[60437f3b60b3af56]::ty::context::TyCtxt, rustc_query_system[c1574a252f7419c]::dep_graph::dep_node::DepNode)>>::call_once
      21:     0x7c34784246d1 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      22:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      23:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      24:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      25:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      26:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      27:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      28:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      29:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      30:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      31:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      32:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      33:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      34:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      35:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      36:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      37:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      38:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      39:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      40:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      41:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      42:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      43:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      44:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      45:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      46:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      47:     0x7c34785dc8d0 - rustc_query_system[c1574a252f7419c]::query::plumbing::try_execute_query::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefaultCache<rustc_type_ir[816d56baed15c9f4]::canonical::CanonicalQueryInput<rustc_middle[60437f3b60b3af56]::ty::context::TyCtxt, rustc_middle[60437f3b60b3af56]::ty::ParamEnvAnd<rustc_middle[60437f3b60b3af56]::ty::predicate::Predicate>>, rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt, true>
      48:     0x7c34785db08b - rustc_query_impl[d10191050d412fc]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
      49:     0x7c34787b5886 - <rustc_trait_selection[6940bf2fe956fe95]::traits::fulfill::FulfillProcessor as rustc_data_structures[369e27e2d68c214b]::obligation_forest::ObligationProcessor>::process_obligation
      50:     0x7c347877454d - <rustc_data_structures[369e27e2d68c214b]::obligation_forest::ObligationForest<rustc_trait_selection[6940bf2fe956fe95]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[6940bf2fe956fe95]::traits::fulfill::FulfillProcessor>
      51:     0x7c347876fe2a - <rustc_trait_selection[6940bf2fe956fe95]::traits::fulfill::FulfillmentContext<rustc_trait_selection[6940bf2fe956fe95]::traits::FulfillmentError> as rustc_infer[e65fffcf22a4bb0e]::traits::engine::TraitEngine<rustc_trait_selection[6940bf2fe956fe95]::traits::FulfillmentError>>::select_all_or_error
      52:     0x7c34770163fe - rustc_hir_analysis[823ad55bc7d74ded]::check::compare_impl_item::collect_return_position_impl_trait_in_trait_tys::{closure#0}
      53:     0x7c34778b5763 - rustc_query_impl[d10191050d412fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d10191050d412fc]::query_impl::collect_return_position_impl_trait_in_trait_tys::dynamic_query::{closure#2}::{closure#0}, rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>
      54:     0x7c34787126f0 - rustc_query_system[c1574a252f7419c]::query::plumbing::try_execute_query::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefIdCache<rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt, true>
      55:     0x7c347920ddc7 - rustc_query_impl[d10191050d412fc]::plumbing::force_from_dep_node::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefIdCache<rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
      56:     0x7c347787db2d - <rustc_query_impl[d10191050d412fc]::plumbing::query_callback<rustc_query_impl[d10191050d412fc]::query_impl::collect_return_position_impl_trait_in_trait_tys::QueryType>::{closure#0} as core[9e3ec3a99e20741e]::ops::function::FnOnce<(rustc_middle[60437f3b60b3af56]::ty::context::TyCtxt, rustc_query_system[c1574a252f7419c]::dep_graph::dep_node::DepNode)>>::call_once
      57:     0x7c34784246d1 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      58:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      59:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      60:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      61:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      62:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      63:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      64:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      65:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      66:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      67:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      68:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      69:     0x7c3478424642 - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      70:     0x7c3478423e6e - <rustc_query_system[c1574a252f7419c]::dep_graph::graph::DepGraphData<rustc_middle[60437f3b60b3af56]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      71:     0x7c3478fc73ea - rustc_query_system[c1574a252f7419c]::query::plumbing::ensure_must_run::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::DefaultCache<rustc_span[200b27ea0e9a3b9b]::def_id::LocalModDefId, rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt>
      72:     0x7c3478e04117 - rustc_query_impl[d10191050d412fc]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
      73:     0x7c347881f624 - rustc_hir_analysis[823ad55bc7d74ded]::check_crate
      74:     0x7c3478de5044 - rustc_interface[aa3cb6198a62650b]::passes::run_required_analyses
      75:     0x7c3478fcf21e - rustc_interface[aa3cb6198a62650b]::passes::analysis
      76:     0x7c3478fcf1ef - rustc_query_impl[d10191050d412fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d10191050d412fc]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 1usize]>>
      77:     0x7c34793291ba - rustc_query_system[c1574a252f7419c]::query::plumbing::try_execute_query::<rustc_query_impl[d10191050d412fc]::DynamicConfig<rustc_query_system[c1574a252f7419c]::query::caches::SingleCache<rustc_middle[60437f3b60b3af56]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[d10191050d412fc]::plumbing::QueryCtxt, true>
      78:     0x7c3479328cb7 - rustc_query_impl[d10191050d412fc]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
      79:     0x7c3479265158 - rustc_interface[aa3cb6198a62650b]::interface::run_compiler::<core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>, rustc_driver_impl[c421ed190efad9be]::run_compiler::{closure#0}>::{closure#1}
      80:     0x7c34792a01e0 - std[1b49f43dde054edc]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[aa3cb6198a62650b]::util::run_in_thread_with_globals<rustc_interface[aa3cb6198a62650b]::util::run_in_thread_pool_with_globals<rustc_interface[aa3cb6198a62650b]::interface::run_compiler<core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>, rustc_driver_impl[c421ed190efad9be]::run_compiler::{closure#0}>::{closure#1}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>::{closure#0}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>
      81:     0x7c347929fefd - <<std[1b49f43dde054edc]::thread::Builder>::spawn_unchecked_<rustc_interface[aa3cb6198a62650b]::util::run_in_thread_with_globals<rustc_interface[aa3cb6198a62650b]::util::run_in_thread_pool_with_globals<rustc_interface[aa3cb6198a62650b]::interface::run_compiler<core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>, rustc_driver_impl[c421ed190efad9be]::run_compiler::{closure#0}>::{closure#1}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>::{closure#0}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9e3ec3a99e20741e]::result::Result<(), rustc_span[200b27ea0e9a3b9b]::ErrorGuaranteed>>::{closure#1} as core[9e3ec3a99e20741e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      82:     0x7c347929f6b9 - std::sys::pal::unix::thread::Thread::new::thread_start::h14f1eb868ff90fc9
      83:     0x7c347349ca94 - start_thread
                                   at ./nptl/pthread_create.c:447:8
      84:     0x7c3473529c3c - clone3
                                   at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      85:                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: rustc 1.84.0 (9fc6b4312 2025-01-07) running on x86_64-unknown-linux-gnu
    
    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 [adt_sized_constraint] computing the `Sized` constraint for `source_document::SourceDocument`
    #1 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@async_graphql::dataloader::DataLoader<source_document::SourceDocumentLoader>::load_one<alloc::string::String>::{closure#0}}: core::marker::Send`
    end of query stack
    there was a panic while trying to force a dep node
    try_mark_green dep node stack:
    #0 TraitSelect(d71a5c0af970ba7-ecb880e2f24d7075)
    #1 TraitSelect(7d07a1e50c3b7d7e-922d6671ae32d41a)
    #2 TraitSelect(7c9b4e86904e9d9d-5d46912d7e23aaee)
    #3 TraitSelect(b2df5ef27be30074-59f6d910312e2b2)
    #4 TraitSelect(107bcfa13c409d86-c66189b0a2e188b6)
    #5 TraitSelect(97af59e50a59c5b2-fd74c06ac9e05f3c)
    #6 TraitSelect(dd1385c018bfb8a9-6b37390051acc3ef)
    #7 TraitSelect(2d8b783da2cff785-d9a598a19176da05)
    #8 TraitSelect(646d3f11afbe7ec8-be9cb39c36746065)
    #9 TraitSelect(9d1c29a6142ad4ef-438b9386d0eb3bb6)
    #10 TraitSelect(24aaf6d00f0f7f81-6c6382791f4872fb)
    #11 TraitSelect(b86341291fd0ad8a-4ac69431d0ffbff3)
    #12 TraitSelect(8a09fddf78b91d4e-a92a7b0edd09643d)
    #13 TraitSelect(c5dee52db89a4d3-ac41ef40e51c48e6)
    #14 TraitSelect(932cef05696b90d5-9addb9dc6c33d4d7)
    #15 TraitSelect(c19b631d1f9e547e-d5ca6e62efa2f1ea)
    #16 TraitSelect(ec176c5d00486f10-ade908c8ae9d1c0f)
    #17 TraitSelect(d4c0f00661dc0a0-5777a1b225342a61)
    #18 TraitSelect(2a68c6b859c417a0-31ab5b49cc4a73f8)
    #19 TraitSelect(9d6a97630bf36897-a4e853d3967e394f)
    #20 TraitSelect(fb5af13856ddf5d9-8d884fec97766d15)
    #21 TraitSelect(259616f282029a82-cde4fb2560986b99)
    #22 TraitSelect(eecfa0cd82749861-eeccd5b7a0ee68a9)
    #23 TraitSelect(140c4ab1675ab6b7-229a21e3f864cc9f)
    #24 TraitSelect(148e92a4762895c9-572f6aee2dc72d7c)
    #25 evaluate_obligation(ca1100f08a7ebb0d-9c5303bae8fb4e29)
    end of try_mark_green dep node stack
    there was a panic while trying to force a dep node
    try_mark_green dep node stack:
    #0 type_of(adt_sized_constraint[872a]::node::_#2::{impl#2}::{synthetic#0})
    #1 TraitSelect(38725ab18e7be709-2b541f1b8c1b59b3)
    #2 TraitSelect(bb6313e1a818efe2-1766fc0ec952170c)
    #3 TraitSelect(38b1cd8bf9a0581e-b6ae5dfa205947ae)
    #4 TraitSelect(5850e8a526434cfe-45289610a3e67206)
    #5 TraitSelect(8d101e12683c1711-704f5fd98111371b)
    #6 TraitSelect(3a467aa77e4beb42-a4b625773317264f)
    #7 TraitSelect(6bfa22578030088f-c31548b18d474c87)
    #8 evaluate_obligation(21d24e828d504da3-e9b93b7a51b8be61)
    #9 collect_return_position_impl_trait_in_trait_tys(adt_sized_constraint[872a]::{impl#2}::resolve_field)
    #10 type_of(adt_sized_constraint[872a]::{impl#2}::{synthetic#0})
    #11 check_well_formed(adt_sized_constraint[872a]::{impl#2})
    #12 check_mod_type_wf(adt_sized_constraint[872a])
    end of try_mark_green dep node stack
    warning: unused variable: `ctx`
      --> src/node.rs:30:36
       |
    30 |     pub async fn version_id(&self, ctx: &async_graphql::Context<'_>) -> ID {
       |                                    ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
       |
       = note: `#[warn(unused_variables)]` on by default
    
    error[E0609]: no field `source` on type `&SourceDocument`
      --> src/source_document.rs:25:17
       |
    25 |         ID(self.source.version_id.clone())
       |                 ^^^^^^ unknown field
    
    Some errors have detailed explanations: E0574, E0609.
    For more information about an error, try `rustc --explain E0574`.
    warning: `adt_sized_constraint` (bin "adt_sized_constraint") generated 1 warning
    error: could not compile `adt_sized_constraint` (bin "adt_sized_constraint") due to 2 previous errors; 1 warning emitted
    
    
  8. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    and removed
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    on Jan 12, 2025
  9. lukas-code commented on Jan 12, 2025

    @lukas-code
    Contributor

    minimized:

    #![allow(dead_code)]
    
    use std::future::Future;
    use std::marker::PhantomData;
    use std::pin::Pin;
    use std::task::{Context, Poll};
    
    #[cfg(not(after))]
    struct SourceDocument {}
    
    #[cfg(after)]
    enum SourceDocument {}
    
    trait Loader {
        type Value;
        fn load(&self) -> impl Future<Output = Self::Value>;
    }
    
    struct SourceDocumentLoader;
    impl Loader for SourceDocumentLoader {
        type Value = SourceDocument;
        async fn load(&self) -> Self::Value {
            todo!()
        }
    }
    
    struct ManualSend<T>(T);
    unsafe impl<T: Send> Send for ManualSend<T> {}
    
    struct PendingButCovariant<T>(PhantomData<T>);
    impl<T> Future for PendingButCovariant<T> {
        type Output = T;
    
        fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
            Poll::Pending
        }
    }
    
    struct DataLoader<T>(T);
    impl<T> DataLoader<T> {
        async fn load_one(&self) -> ManualSend<T::Value>
        where
            T: Loader,
        {
            PendingButCovariant(PhantomData).await
        }
    }
    
    trait ContainerType {
        fn resolve_field(&self) -> impl Future<Output = ()> + Send;
    }
    impl ContainerType for () {
        async fn resolve_field(&self) {
            let loader = DataLoader(SourceDocumentLoader);
            loader.load_one().await;
        }
    }
    
    fn main() {}

    run:

    rustc --edition 2021 -C incremental=incremental file.rs
    rustc --edition 2021 -C incremental=incremental file.rs --cfg after
  10. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    and removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Jan 12, 2025
  11. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 14, 2025
  12. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Jun 24, 2025
  13. added a commit that references this issue on Aug 8, 2026
  14. added a commit that references this issue on Aug 8, 2026
  15. added a commit that references this issue on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions