Closed as not planned
Closed as not planned
Description
I built a stage2 compiler locally using 5b33de3 with parallel-compiler = true
. I then tried compiling this code which uses the windows crate using the following cargo invocation: cargo +stage2 rustc -v -- -Z threads=2
. This lead to the following error:
thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: DefId(0:212365 ~ bindings[1e33]::windows::ui::composition::{impl#366})
- dep-node: hir_attrs(af94ef94cd884db-755310723ccea34d)',
thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: DefId(0:212365 ~ bindings[1e33]::windows::ui::composition::{impl#366})
- dep-node: hir_attrs(af94ef94cd884db-755310723ccea34d)', C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:612:5
stack backtrace:
0: std::panicking::begin_panic_handler
at C:\Users\ryanl\Code\rust\library\std\src\panicking.rs:493
1: std::panicking::begin_panic_fmt
at C:\Users\ryanl\Code\rust\library\std\src\panicking.rs:435
2: rustc_query_system::query::plumbing::force_query_with_job<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, rustc_middle::hir::AttributeMap>,rustc_query_impl::plumbing::QueryCtxt>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:612
3: rustc_query_system::query::plumbing::try_execute_query
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:496
4: rustc_query_system::query::plumbing::get_query_impl<rustc_query_impl::plumbing::QueryCtxt,rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, rustc_middle::hir::AttributeMap>>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:671
5: rustc_query_system::query::plumbing::get_query<rustc_query_impl::queries::hir_attrs,rustc_query_impl::plumbing::QueryCtxt>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:782
6: rustc_middle::ty::query::TyCtxtAt::hir_attrs
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\query\mod.rs:205
7: rustc_middle::ty::context::TyCtxt::hir_attrs
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\query\mod.rs:186
8: rustc_middle::hir::map::Map::attrs
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\hir\map\mod.rs:848
9: rustc_interface::proc_macro_decls::{{impl}}::visit_item
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\proc_macro_decls.rs:28
10: rustc_hir::hir::Crate::visit_all_item_likes<rustc_interface::proc_macro_decls::Finder>
at C:\Users\ryanl\Code\rust\compiler\rustc_hir\src\hir.rs:717
11: rustc_interface::proc_macro_decls::proc_macro_decls_static
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\proc_macro_decls.rs:16
12: rustc_query_system::dep_graph::graph::{{impl}}::with_task_impl::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:277
13: rustc_middle::dep_graph::{{impl}}::with_deps::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:76
14: rustc_middle::ty::context::tls::enter_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
15: rustc_rayon_core::tlv::with<closure-0,core::option::Option<rustc_span::def_id::DefId>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\tlv.rs:19
16: rustc_middle::ty::context::tls::set_tlv
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1684
17: rustc_middle::ty::context::tls::enter_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
18: rustc_middle::dep_graph::{{impl}}::with_deps::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:76
19: rustc_middle::ty::context::tls::with_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
20: rustc_middle::ty::context::tls::with_context_opt
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1743
21: rustc_middle::ty::context::tls::with_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
22: rustc_middle::dep_graph::{{impl}}::with_deps<closure-0,core::option::Option<rustc_span::def_id::DefId>>
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:73
23: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl<rustc_middle::dep_graph::dep_node::DepKind,rustc_query_impl::plumbing::QueryCtxt,rustc_span::def_id::CrateNum,core::option::Option<rustc_span::def_id::DefId>,fn(mut rustc_middle::ich::hcx::Sta
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:277
24: rustc_query_system::dep_graph::graph::DepGraph::with_task
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:247
25: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:634
26: stacker::maybe_grow
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\stacker-0.1.12\src\lib.rs:55
27: rustc_data_structures::stack::ensure_sufficient_stack<tuple<core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex>,closure-0>
at C:\Users\ryanl\Code\rust\compiler\rustc_data_structures\src\stack.rs:16
28: rustc_query_impl::plumbing::{{impl}}::start_query::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_impl\src\plumbing.rs:169
29: rustc_middle::ty::context::tls::enter_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
30: rustc_rayon_core::tlv::with<closure-0,tuple<core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\tlv.rs:19
31: rustc_middle::ty::context::tls::set_tlv
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1684
32: rustc_middle::ty::context::tls::enter_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
33: rustc_query_impl::plumbing::{{impl}}::start_query::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_impl\src\plumbing.rs:168
34: rustc_middle::ty::context::tls::with_related_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1770
35: rustc_middle::ty::context::tls::with_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
36: rustc_middle::ty::context::tls::with_context_opt
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1743
37: rustc_middle::ty::context::tls::with_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
38: rustc_middle::ty::context::tls::with_related_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1767
39: rustc_query_impl::plumbing::{{impl}}::start_query
at C:\Users\ryanl\Code\rust\compiler\rustc_query_impl\src\plumbing.rs:157
40: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:624
41: rustc_query_system::query::plumbing::with_diagnostics
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:328
42: rustc_query_system::query::plumbing::force_query_with_job<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::CrateNum, core::option::Option<rustc_span::def_id::DefId>>,rustc_query_impl::plumbing::QueryCtxt>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:623
43: rustc_query_system::query::plumbing::try_execute_query
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:496
44: rustc_query_system::query::plumbing::get_query_impl<rustc_query_impl::plumbing::QueryCtxt,rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::CrateNum, core::option::Option<rustc_span::def_id::DefId>>>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:671
45: rustc_query_system::query::plumbing::get_query<rustc_query_impl::queries::proc_macro_decls_static,rustc_query_impl::plumbing::QueryCtxt>
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:782
46: rustc_middle::ty::query::TyCtxtAt::proc_macro_decls_static
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\query\mod.rs:205
47: rustc_middle::ty::context::TyCtxt::proc_macro_decls_static
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\query\mod.rs:186
48: rustc_interface::proc_macro_decls::find
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\proc_macro_decls.rs:9
49: rustc_interface::passes::analysis::{{closure}}::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\passes.rs:860
50: rustc_data_structures::profiling::VerboseTimingGuard::run
at C:\Users\ryanl\Code\rust\compiler\rustc_data_structures\src\profiling.rs:573
51: rustc_session::session::Session::time<core::option::Option<rustc_span::def_id::DefId>,closure-3>
at C:\Users\ryanl\Code\rust\compiler\rustc_session\src\utils.rs:10
52: std::panicking::try::do_call
at C:\Users\ryanl\Code\rust\library\std\src\panicking.rs:379
53: std::panicking::try<tuple<>,std::panic::AssertUnwindSafe<closure-0>>
at C:\Users\ryanl\Code\rust\library\std\src\panicking.rs:343
54: std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure-0>,tuple<>>
at C:\Users\ryanl\Code\rust\library\std\src\panic.rs:431
55: rustc_rayon_core::unwind::halt_unwinding
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\unwind.rs:17
56: rustc_rayon_core::scope::ScopeBase::execute_job_closure
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\scope\mod.rs:569
57: rustc_rayon_core::scope::ScopeBase::complete<closure-0,tuple<>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\scope\mod.rs:542
58: rustc_rayon_core::scope::scope::{{closure}}
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\scope\mod.rs:298
59: rustc_rayon_core::registry::in_worker<closure-0,tuple<>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\registry.rs:847
60: rustc_rayon_core::scope::scope
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\scope\mod.rs:296
61: rustc_interface::passes::analysis::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\passes.rs:908
62: rustc_data_structures::profiling::VerboseTimingGuard::run
at C:\Users\ryanl\Code\rust\compiler\rustc_data_structures\src\profiling.rs:573
63: rustc_session::session::Session::time<tuple<>,closure-0>
at C:\Users\ryanl\Code\rust\compiler\rustc_session\src\utils.rs:10
64: rustc_interface::passes::analysis
at C:\Users\ryanl\Code\rust\compiler\rustc_interface\src\passes.rs:830
65: rustc_query_system::dep_graph::graph::{{impl}}::with_task_impl::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:277
66: rustc_middle::dep_graph::{{impl}}::with_deps::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:76
67: rustc_middle::ty::context::tls::enter_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
68: rustc_rayon_core::tlv::with<closure-0,core::result::Result<tuple<>, rustc_errors::ErrorReported>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\tlv.rs:19
69: rustc_middle::ty::context::tls::set_tlv
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1684
70: rustc_middle::ty::context::tls::enter_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
71: rustc_middle::dep_graph::{{impl}}::with_deps::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:76
72: rustc_middle::ty::context::tls::with_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
73: rustc_middle::ty::context::tls::with_context_opt
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1743
74: rustc_middle::ty::context::tls::with_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1754
75: rustc_middle::dep_graph::{{impl}}::with_deps<closure-0,bool>
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\dep_graph\mod.rs:73
76: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl<rustc_middle::dep_graph::dep_node::DepKind,rustc_query_impl::plumbing::QueryCtxt,rustc_span::def_id::CrateNum,rustc_target::spec::PanicStrategy,fn(mut rustc_middle::ich::hcx::StableHashingCont
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:277
77: rustc_query_system::dep_graph::graph::DepGraph::with_eval_always_task<rustc_middle::dep_graph::dep_node::DepKind,rustc_query_impl::plumbing::QueryCtxt,rustc_span::def_id::CrateNum,bool,fn(mut rustc_middle::ich::hcx::StableHashingContext*, bool*) -> core::
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\dep_graph\graph.rs:421
78: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_system\src\query\plumbing.rs:626
79: stacker::maybe_grow
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\stacker-0.1.12\src\lib.rs:55
80: rustc_data_structures::stack::ensure_sufficient_stack<tuple<core::result::Result<tuple<>, rustc_errors::ErrorReported>, rustc_query_system::dep_graph::graph::DepNodeIndex>,closure-0>
at C:\Users\ryanl\Code\rust\compiler\rustc_data_structures\src\stack.rs:16
81: rustc_query_impl::plumbing::{{impl}}::start_query::{{closure}}::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_query_impl\src\plumbing.rs:169
82: rustc_middle::ty::context::tls::enter_context::{{closure}}
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
83: rustc_rayon_core::tlv::with<closure-0,tuple<core::result::Result<tuple<>, rustc_errors::ErrorReported>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
at C:\Users\ryanl\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-rayon-core-0.3.1\src\tlv.rs:19
84: rustc_middle::ty::context::tls::set_tlv
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1684
85: rustc_middle::ty::context::tls::enter_context
at C:\Users\ryanl\Code\rust\compiler\rustc_middle\src\ty\context.rs:1726
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.53.0-dev running on x86_64-pc-windows-msvc
note: compiler flags: -Z threads=2 -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [proc_macro_decls_static] looking up the derive registrar for a crate
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `bindings`
This panic message is similar to the error message in #82991 which also surfaces when cross compiling this code with a non-parallel compiler.
This happens when running with -Z threads=N
where N >= 2 (well only tested with 2 and 4).