rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.34k stars 12.72k forks source link

thread 'rustc' panicked at 'forcing query with already existing `DepNode` #109655

Open xiaohongxiedaima opened 1 year ago

xiaohongxiedaima commented 1 year ago

Code

<code>

Meta

rustc --version --verbose:

rustc 1.67.0-nightly (e75aab045 2022-11-09)
binary: rustc
commit-hash: e75aab045fc476f176a58c408f6b06f0e275c6e1
commit-date: 2022-11-09
host: x86_64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

Error output

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Binder(TraitPredicate(<for<'a, 'b, 'c, 'd, 'e, 'f> {std::future::ResumeTy, &'a mut (dyn rbdc::db::Connection + 'b), &'c mut std::boxed::Box<(dyn rbdc::db::Connection + 'd)>, &'e str, std::vec::Vec<rbs::Value>, std::pin::Pin<std::boxed::Box<(dyn futures_core::Future<Output = std::result::Result<rbdc::db::ExecResult, rbdc::Error>> + std::marker::Send + 'f)>>, ()} as std::marker::Send>, polarity:Positive), []) } }
- dep-node: evaluate_obligation(4ea368f0dd25d937-61d89953b63c2540)', /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/compiler/rustc_query_system/src/dep_graph/graph.rs:316:9
Backtrace

``` stack backtrace: 0: 0x10e4d5f12 - ::fmt::h1b594e9bcc0c6898 1: 0x10e5344ba - core::fmt::write::h7c6f83d024852aa9 2: 0x10e4c7fec - std::io::Write::write_fmt::h97d969d4aea1606d 3: 0x10e4d5cda - std::sys_common::backtrace::print::h562dadf6028256bf 4: 0x10e4d90b6 - std::panicking::default_hook::{{closure}}::hee367e24075678e4 5: 0x10e4d8e07 - std::panicking::default_hook::hcce3553a0befadd1 6: 0x11717af3d - rustc_driver[f93b8a3886cc8b65]::DEFAULT_HOOK::{closure#0}::{closure#0} 7: 0x10e4d98b5 - std::panicking::rust_panic_with_hook::h4f6feaafc55c56a2 8: 0x10e4d9643 - std::panicking::begin_panic_handler::{{closure}}::hde5e87cf8416de78 9: 0x10e4d63a8 - std::sys_common::backtrace::__rust_end_short_backtrace::h06c292cffdb0bbc3 10: 0x10e4d930d - _rust_begin_unwind 11: 0x10e561053 - core::panicking::panic_fmt::he51d66482c616f28 12: 0x11ac534e0 - >::with_task::>, core[322641b34a183a]::result::Result> 13: 0x11a957d5d - rustc_query_system[38b064a260926677]::query::plumbing::try_execute_query::>, core[322641b34a183a]::result::Result>> 14: 0x11aa68d1d - rustc_query_system[38b064a260926677]::query::plumbing::get_query:: 15: 0x11ab1d509 - ::evaluate_obligation 16: 0x11b671df9 - ::evaluate_obligation 17: 0x11b671eef - ::evaluate_obligation_no_overflow 18: 0x11b6c0b4d - ::process_trait_obligation 19: 0x11b6c02e2 - ::process_obligation 20: 0x11b64dc46 - >::process_obligations:: 21: 0x11b6bc23a - ::select_where_possible 22: 0x11b6bc10a - ::select_all_or_error 23: 0x1199e82f1 - ::select_all_obligations_or_error 24: 0x119ac2b93 - ::enter::::{closure#0}::{closure#1}, &rustc_middle[85091bb6846d2e9a]::ty::context::TypeckResults> 25: 0x119a5bffa - rustc_hir_typeck[bdb15a1f3923c127]::typeck 26: 0x11ac5fc38 - >::with_task:: 27: 0x11a96e2fd - rustc_query_system[38b064a260926677]::query::plumbing::try_execute_query::> 28: 0x11aa73b8c - rustc_query_system[38b064a260926677]::query::plumbing::get_query:: 29: 0x119aeb76c - std[38dd6138ba148cb2]::panicking::try::<(), core[322641b34a183a]::panic::unwind_safe::AssertUnwindSafe::par_body_owners::{closure#0}>::{closure#0}::{closure#0}>> 30: 0x119aeb4a5 - rustc_data_structures[2eed7d44fa552923]::sync::par_for_each_in::<&[rustc_span[50ad8565b2f1bbfb]::def_id::LocalDefId], ::par_body_owners::{closure#0}> 31: 0x119a5b77d - rustc_hir_typeck[bdb15a1f3923c127]::typeck_item_bodies 32: 0x11aca288d - >::with_task:: 33: 0x11aa081cb - rustc_query_system[38b064a260926677]::query::plumbing::try_execute_query::> 34: 0x11aa68339 - rustc_query_system[38b064a260926677]::query::plumbing::get_query:: 35: 0x119bd43f4 - ::time::<(), rustc_hir_analysis[e85e3b9a54dc24a9]::check_crate::{closure#7}> 36: 0x119cf35df - rustc_hir_analysis[e85e3b9a54dc24a9]::check_crate 37: 0x11723e3ba - rustc_interface[bab52cec3fba6e57]::passes::analysis 38: 0x11ac9594a - >::with_task::> 39: 0x11a9f9f9e - rustc_query_system[38b064a260926677]::query::plumbing::try_execute_query::>> 40: 0x11aa73f39 - rustc_query_system[38b064a260926677]::query::plumbing::get_query:: 41: 0x11710a416 - ::enter::> 42: 0x11714e68d - rustc_span[50ad8565b2f1bbfb]::with_source_map::, rustc_interface[bab52cec3fba6e57]::interface::run_compiler, rustc_driver[f93b8a3886cc8b65]::run_compiler::{closure#1}>::{closure#0}::{closure#1}> 43: 0x11713e5bc - >::set::, rustc_driver[f93b8a3886cc8b65]::run_compiler::{closure#1}>::{closure#0}, core[322641b34a183a]::result::Result<(), rustc_errors[ef89fc2f19a46f90]::ErrorGuaranteed>> 44: 0x11710d37a - std[38dd6138ba148cb2]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[f93b8a3886cc8b65]::run_compiler::{closure#1}>::{closure#0}, core[322641b34a183a]::result::Result<(), rustc_errors[ef89fc2f19a46f90]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[322641b34a183a]::result::Result<(), rustc_errors[ef89fc2f19a46f90]::ErrorGuaranteed>> 45: 0x1170f3b4b - <::spawn_unchecked_, rustc_driver[f93b8a3886cc8b65]::run_compiler::{closure#1}>::{closure#0}, core[322641b34a183a]::result::Result<(), rustc_errors[ef89fc2f19a46f90]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[322641b34a183a]::result::Result<(), rustc_errors[ef89fc2f19a46f90]::ErrorGuaranteed>>::{closure#1} as core[322641b34a183a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 46: 0x10e4e2967 - std::sys::unix::thread::Thread::new::thread_start::hae9a83a2ac729f3b 47: 0x7ff806914259 - __pthread_start error: internal compiler error: unexpected panic note: 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: rustc 1.67.0-nightly (e75aab045 2022-11-09) running on x86_64-apple-darwin note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -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 `for<'a, 'b, 'c, 'd, 'e, 'f> {core::future::ResumeTy, &'a mut (dyn rbdc::db::Connection + 'b), &'c mut alloc::boxed::Box<(dyn rbdc::db::Connection + 'd)>, &'e str, alloc::vec::Vec, core::pin::Pin> + core::marker::Send + 'f)>>, ()}: core::marker::Send` #1 [typeck] type-checking `sql::tx::::commit` #2 [typeck_item_bodies] type-checking all item bodies #3 [analysis] running analysis passes on this crate ```

clubby789 commented 1 year ago

This looks like an issue with incremental compilation. cargo clean and a recompile may help

@rustbot label +A-incr-comp