Skip to content

ICE when building rustc_middle with some query-related trait bounds not satisfied #140931

Closed
@RalfJung

Description

@RalfJung

Code

Apply the following patch to rustc:

diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs
index 6ff3cac049b..7486be69daf 100644
--- a/compiler/rustc_middle/src/mir/interpret/error.rs
+++ b/compiler/rustc_middle/src/mir/interpret/error.rs
@@ -101,7 +101,7 @@ fn from(val: ReportedErrorInfo) -> Self {
 /// because the value contains something of type `ty` that is not valtree-compatible.
 /// The caller can then show an appropriate error; the query does not have the
 /// necessary context to give good user-facing errors for this case.
-pub type EvalToValTreeResult<'tcx> = Result<Result<ValTree<'tcx>, Ty<'tcx>>, ErrorHandled>;
+pub type EvalToValTreeResult<'tcx> = Result<Either<ValTree<'tcx>, Ty<'tcx>>, ErrorHandled>;
 
 #[cfg(target_pointer_width = "64")]
 rustc_data_structures::static_assert_size!(InterpErrorInfo<'_>, 8);

Meta

Whatever bootstrap compiler rustc currently uses

Error output

There are a lot of errors, and then an ICE:

error: internal compiler error: compiler/rustc_trait_selection/src/traits/normalize.rs:69:17: deeply_normalize should not be called with pending obligations: [
                                    Obligation(predicate=Binder { value: OutlivesPredicate('?1, '?1), bound_vars: [] }, depth=0),
                                ]


thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:69:17:
Box<dyn Any>
stack backtrace:
   0:     0x7fa6ea87c613 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::had6e551bdf697010
   1:     0x7fa6eb005d91 - core::fmt::write::h9e37a39b0361e225
   2:     0x7fa6ec1815d1 - std::io::Write::write_fmt::h1df079672db6f5be
   3:     0x7fa6ea87c472 - std::sys::backtrace::BacktraceLock::print::h84aaeea67cd911a4
   4:     0x7fa6ea87ed2a - std::panicking::default_hook::{{closure}}::he4b444e817d4c55b
   5:     0x7fa6ea87e8af - std::panicking::default_hook::h80ec831a3e3e04cd
   6:     0x7fa6e98e5310 - std[41ff0dbd664e2dc2]::panicking::update_hook::<alloc[63a6662ec60f2805]::boxed::Box<rustc_driver_impl[17ca36e85839b9c8]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7fa6ea87f5a3 - std::panicking::rust_panic_with_hook::hd8821efb9bfec5df
   8:     0x7fa6e9924611 - std[41ff0dbd664e2dc2]::panicking::begin_panic::<rustc_errors[bc18beab6d94fb57]::ExplicitBug>::{closure#0}
   9:     0x7fa6e99182d6 - std[41ff0dbd664e2dc2]::sys::backtrace::__rust_end_short_backtrace::<std[41ff0dbd664e2dc2]::panicking::begin_panic<rustc_errors[bc18beab6d94fb57]::ExplicitBug>::{closure#0}, !>
  10:     0x7fa6e9914c29 - std[41ff0dbd664e2dc2]::panicking::begin_panic::<rustc_errors[bc18beab6d94fb57]::ExplicitBug>
  11:     0x7fa6e992dfd1 - <rustc_errors[bc18beab6d94fb57]::diagnostic::BugAbort as rustc_errors[bc18beab6d94fb57]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7fa6e9ecf39c - <rustc_errors[bc18beab6d94fb57]::DiagCtxtHandle>::span_bug::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span, alloc[63a6662ec60f2805]::string::String>
  13:     0x7fa6e9f69877 - rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}
  14:     0x7fa6e9f452ea - rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_opt::<rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7fa6e9f4515b - rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_context_opt::<rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_opt<rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7fa6e7a2e9a7 - rustc_middle[80461b7d4018fbd4]::util::bug::span_bug_fmt::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>
  17:     0x7fa6eb84d486 - <rustc_trait_selection[5e6f5e63d48e3d03]::traits::engine::ObligationCtxt>::deeply_normalize::<rustc_middle[80461b7d4018fbd4]::ty::Ty>
  18:     0x7fa6eb1b8b5d - rustc_trait_selection[5e6f5e63d48e3d03]::traits::query::dropck_outlives::compute_dropck_outlives_inner
  19:     0x7fa6eb673364 - rustc_traits[9bed9e12332a3392]::dropck_outlives::dropck_outlives
  20:     0x7fa6eb672e26 - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>
  21:     0x7fa6eb672deb - <rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::dynamic_query::{closure#2} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<(rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::DropckOutlives>>)>>::call_once
  22:     0x7fa6eb672dad - <rustc_query_system[70e091e811290e7d]::query::plumbing::execute_job_incr<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<((rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>), rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>)>>::call_once
  23:     0x7fa6eb92fdd8 - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::DropckOutlives>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  24:     0x7fa6eb92f716 - rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::get_query_incr::__rust_end_short_backtrace
  25:     0x7fa6eb8594fd - <rustc_borrowck[7603524d21067fa7]::type_check::liveness::trace::LivenessContext>::compute_drop_data
  26:     0x7fa6e829b947 - rustc_borrowck[7603524d21067fa7]::type_check::liveness::trace::trace
  27:     0x7fa6e82c51fd - rustc_borrowck[7603524d21067fa7]::type_check::type_check
  28:     0x7fa6e8284fa3 - rustc_borrowck[7603524d21067fa7]::nll::compute_regions
  29:     0x7fa6ec1c0343 - rustc_borrowck[7603524d21067fa7]::do_mir_borrowck
  30:     0x7fa6ec1b016c - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7fa6eb36ab18 - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  32:     0x7fa6eb36e6b0 - rustc_query_impl[db10edd006496e38]::plumbing::force_from_dep_node::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>>
  33:     0x7fa6ec4b2111 - <rustc_query_impl[db10edd006496e38]::plumbing::query_callback<rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::QueryType>::{closure#0} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<(rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_query_system[70e091e811290e7d]::dep_graph::dep_node::DepNode, rustc_query_system[70e091e811290e7d]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  34:     0x7fa6eb0192c1 - <rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepGraphData<rustc_middle[80461b7d4018fbd4]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>
  35:     0x7fa6eb3875be - rustc_query_system[70e091e811290e7d]::query::plumbing::ensure_must_run::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>
  36:     0x7fa6eb387198 - rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  37:     0x7fa6eb923fcd - rustc_interface[9abced68ad600168]::passes::run_required_analyses
  38:     0x7fa6ec18795e - rustc_interface[9abced68ad600168]::passes::analysis
  39:     0x7fa6ec187933 - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 0usize]>>
  40:     0x7fa6ec18a27d - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::SingleCache<rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  41:     0x7fa6ec189ba9 - rustc_query_impl[db10edd006496e38]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  42:     0x7fa6ec14000d - rustc_interface[9abced68ad600168]::passes::create_and_enter_global_ctxt::<core[5fd6bfabdd2b4c2b]::option::Option<rustc_interface[9abced68ad600168]::queries::Linker>, rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  43:     0x7fa6ec1286aa - rustc_interface[9abced68ad600168]::interface::run_compiler::<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}
  44:     0x7fa6ec0f5608 - std[41ff0dbd664e2dc2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[9abced68ad600168]::util::run_in_thread_with_globals<rustc_interface[9abced68ad600168]::util::run_in_thread_pool_with_globals<rustc_interface[9abced68ad600168]::interface::run_compiler<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  45:     0x7fa6ec0f5ef4 - <<std[41ff0dbd664e2dc2]::thread::Builder>::spawn_unchecked_<rustc_interface[9abced68ad600168]::util::run_in_thread_with_globals<rustc_interface[9abced68ad600168]::util::run_in_thread_pool_with_globals<rustc_interface[9abced68ad600168]::interface::run_compiler<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7fa6ec0f72eb - std::sys::pal::unix::thread::Thread::new::thread_start::h82c6b7e8ccb00138
  47:     0x7fa6e5e9cb7b - start_thread
                               at ./nptl/pthread_create.c:448:8
  48:     0x7fa6e5f1a7b8 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  49:                0x0 - <unknown>

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.87.0-beta.1 (45165c82a 2025-04-01) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -C incremental=[REDACTED] -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C llvm-args=-import-instr-limit=10 -Z on-broken-pipe=kill -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [dropck_outlives] computing dropck types for `ty::context::GlobalCtxt<'_>`
#1 [mir_borrowck] borrow-checking `ty::context::<impl at compiler/rustc_middle/src/ty/context.rs:1515:1: 1515:24>::create_global_ctxt::{closure#1}`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 mir_borrowck(rustc_middle[db4e]::ty::context::{impl#24}::create_global_ctxt)
end of try_mark_green dep node stack

thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:69:17:
Box<dyn Any>
stack backtrace:
   0:     0x7f82b007c613 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::had6e551bdf697010
   1:     0x7f82b0805d91 - core::fmt::write::h9e37a39b0361e225
   2:     0x7f82b19815d1 - std::io::Write::write_fmt::h1df079672db6f5be
   3:     0x7f82b007c472 - std::sys::backtrace::BacktraceLock::print::h84aaeea67cd911a4
   4:     0x7f82b007ed2a - std::panicking::default_hook::{{closure}}::he4b444e817d4c55b
   5:     0x7f82b007e8af - std::panicking::default_hook::h80ec831a3e3e04cd
   6:     0x7f82af0e5310 - std[41ff0dbd664e2dc2]::panicking::update_hook::<alloc[63a6662ec60f2805]::boxed::Box<rustc_driver_impl[17ca36e85839b9c8]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f82b007f5a3 - std::panicking::rust_panic_with_hook::hd8821efb9bfec5df
   8:     0x7f82af124611 - std[41ff0dbd664e2dc2]::panicking::begin_panic::<rustc_errors[bc18beab6d94fb57]::ExplicitBug>::{closure#0}
   9:     0x7f82af1182d6 - std[41ff0dbd664e2dc2]::sys::backtrace::__rust_end_short_backtrace::<std[41ff0dbd664e2dc2]::panicking::begin_panic<rustc_errors[bc18beab6d94fb57]::ExplicitBug>::{closure#0}, !>
  10:     0x7f82af114c29 - std[41ff0dbd664e2dc2]::panicking::begin_panic::<rustc_errors[bc18beab6d94fb57]::ExplicitBug>
  11:     0x7f82af12dfd1 - <rustc_errors[bc18beab6d94fb57]::diagnostic::BugAbort as rustc_errors[bc18beab6d94fb57]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7f82af6cf39c - <rustc_errors[bc18beab6d94fb57]::DiagCtxtHandle>::span_bug::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span, alloc[63a6662ec60f2805]::string::String>
  13:     0x7f82af769877 - rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}
  14:     0x7f82af7452ea - rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_opt::<rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7f82af74515b - rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_context_opt::<rustc_middle[80461b7d4018fbd4]::ty::context::tls::with_opt<rustc_middle[80461b7d4018fbd4]::util::bug::opt_span_bug_fmt<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7f82ad22e9a7 - rustc_middle[80461b7d4018fbd4]::util::bug::span_bug_fmt::<rustc_span[c3c4ef5d7f88161]::span_encoding::Span>
  17:     0x7f82b104d486 - <rustc_trait_selection[5e6f5e63d48e3d03]::traits::engine::ObligationCtxt>::deeply_normalize::<rustc_middle[80461b7d4018fbd4]::ty::Ty>
  18:     0x7f82b09b8b5d - rustc_trait_selection[5e6f5e63d48e3d03]::traits::query::dropck_outlives::compute_dropck_outlives_inner
  19:     0x7f82b0e73364 - rustc_traits[9bed9e12332a3392]::dropck_outlives::dropck_outlives
  20:     0x7f82b0e72e26 - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>
  21:     0x7f82b0e72deb - <rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::dynamic_query::{closure#2} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<(rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::DropckOutlives>>)>>::call_once
  22:     0x7f82b0e72dad - <rustc_query_system[70e091e811290e7d]::query::plumbing::execute_job_incr<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<((rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>), rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::Normalize<rustc_middle[80461b7d4018fbd4]::ty::Ty>>>)>>::call_once
  23:     0x7f82b112fdd8 - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::DefaultCache<rustc_type_ir[3091dc864f16e166]::canonical::CanonicalQueryInput<rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_middle[80461b7d4018fbd4]::ty::ParamEnvAnd<rustc_middle[80461b7d4018fbd4]::traits::query::type_op::DropckOutlives>>, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  24:     0x7f82b112f716 - rustc_query_impl[db10edd006496e38]::query_impl::dropck_outlives::get_query_incr::__rust_end_short_backtrace
  25:     0x7f82b10594fd - <rustc_borrowck[7603524d21067fa7]::type_check::liveness::trace::LivenessContext>::compute_drop_data
  26:     0x7f82ada9b947 - rustc_borrowck[7603524d21067fa7]::type_check::liveness::trace::trace
  27:     0x7f82adac51fd - rustc_borrowck[7603524d21067fa7]::type_check::type_check
  28:     0x7f82ada84fa3 - rustc_borrowck[7603524d21067fa7]::nll::compute_regions
  29:     0x7f82b19c0343 - rustc_borrowck[7603524d21067fa7]::do_mir_borrowck
  30:     0x7f82b19b016c - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7f82b0b6ab18 - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  32:     0x7f82b0b6e6b0 - rustc_query_impl[db10edd006496e38]::plumbing::force_from_dep_node::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>>
  33:     0x7f82b1cb2111 - <rustc_query_impl[db10edd006496e38]::plumbing::query_callback<rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::QueryType>::{closure#0} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<(rustc_middle[80461b7d4018fbd4]::ty::context::TyCtxt, rustc_query_system[70e091e811290e7d]::dep_graph::dep_node::DepNode, rustc_query_system[70e091e811290e7d]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  34:     0x7f82b08192c1 - <rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepGraphData<rustc_middle[80461b7d4018fbd4]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>
  35:     0x7f82b0b875be - rustc_query_system[70e091e811290e7d]::query::plumbing::ensure_must_run::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_data_structures[9915193eb5406c5c]::vec_cache::VecCache<rustc_span[c3c4ef5d7f88161]::def_id::LocalDefId, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[70e091e811290e7d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt>
  36:     0x7f82b0b87198 - rustc_query_impl[db10edd006496e38]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  37:     0x7f82b1123fcd - rustc_interface[9abced68ad600168]::passes::run_required_analyses
  38:     0x7f82b198795e - rustc_interface[9abced68ad600168]::passes::analysis
  39:     0x7f82b1987933 - rustc_query_impl[db10edd006496e38]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db10edd006496e38]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 0usize]>>
  40:     0x7f82b198a27d - rustc_query_system[70e091e811290e7d]::query::plumbing::try_execute_query::<rustc_query_impl[db10edd006496e38]::DynamicConfig<rustc_query_system[70e091e811290e7d]::query::caches::SingleCache<rustc_middle[80461b7d4018fbd4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[db10edd006496e38]::plumbing::QueryCtxt, true>
  41:     0x7f82b1989ba9 - rustc_query_impl[db10edd006496e38]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  42:     0x7f82b194000d - rustc_interface[9abced68ad600168]::passes::create_and_enter_global_ctxt::<core[5fd6bfabdd2b4c2b]::option::Option<rustc_interface[9abced68ad600168]::queries::Linker>, rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  43:     0x7f82b19286aa - rustc_interface[9abced68ad600168]::interface::run_compiler::<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}
  44:     0x7f82b18f5608 - std[41ff0dbd664e2dc2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[9abced68ad600168]::util::run_in_thread_with_globals<rustc_interface[9abced68ad600168]::util::run_in_thread_pool_with_globals<rustc_interface[9abced68ad600168]::interface::run_compiler<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  45:     0x7f82b18f5ef4 - <<std[41ff0dbd664e2dc2]::thread::Builder>::spawn_unchecked_<rustc_interface[9abced68ad600168]::util::run_in_thread_with_globals<rustc_interface[9abced68ad600168]::util::run_in_thread_pool_with_globals<rustc_interface[9abced68ad600168]::interface::run_compiler<(), rustc_driver_impl[17ca36e85839b9c8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[5fd6bfabdd2b4c2b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f82b18f72eb - std::sys::pal::unix::thread::Thread::new::thread_start::h82c6b7e8ccb00138
For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_middle` (lib) due to 22 previous errors
warning: build failed, waiting for other jobs to finish...
  47:     0x7f82ab69cb7b - start_thread
                               at ./nptl/pthread_create.c:448:8
  48:     0x7f82ab71a7b8 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  49:                0x0 - <unknown>

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.87.0-beta.1 (45165c82a 2025-04-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -C incremental=[REDACTED] -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C llvm-args=-import-instr-limit=10 -Z on-broken-pipe=kill -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [dropck_outlives] computing dropck types for `ty::context::GlobalCtxt<'_>`
#1 [mir_borrowck] borrow-checking `ty::context::<impl at compiler/rustc_middle/src/ty/context.rs:1515:1: 1515:24>::create_global_ctxt::{closure#1}`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 mir_borrowck(rustc_middle[e891]::ty::context::{impl#24}::create_global_ctxt)
end of try_mark_green dep node stack
error: could not compile `rustc_middle` (lib test) due to 22 previous errors
Build completed unsuccessfully in 0:00:04

Cc @rust-lang/types

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions