Open sebschmi opened 3 years ago
I've also seen this ICE on:
rustc 1.57.0-nightly (d7c97a02d 2021-10-12)
binary: rustc
commit-hash: d7c97a02d1215e4ef26c31cb72dbaf16fd548b2c
commit-date: 2021-10-12
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0
It was reproducible with the same cache state, but it was resolved by clearing the cache.
Here is the backtrace:
I've seen the same error on:
rustc 1.59.0-nightly (efec54529 2021-12-04)
binary: rustc
commit-hash: efec545293b9263be9edfb283a7aa66350b3acbf
commit-date: 2021-12-04
host: x86_64-apple-darwin
release: 1.59.0-nightly
LLVM version: 13.0.0
It was resolved by cargo clean
but unfortunately I can't reproduce it again and provide the backtrace.
I strongly suspect that this has the same underlying cause as https://github.com/rust-lang/rust/issues/91696#issuecomment-993043710
Code
See https://github.com/algbio/practical-omnitigs. Branch
sebschmi/ICE
The Rust code is in the subfolderimplementation
.Run
cargo test
to reproduce.I am sorry, but I am not able to provide a minimal example at the moment.
Meta
rustc --version --verbose
:Full error output
Backtrace
``` error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:838:18: get_adt_def called on a non-ADT DefId(21:855 ~ traitgraph[39ee]::walks::VecNodeWalk) thread 'rustc' panicked at 'Box', /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panic.rs:59:5
stack backtrace:
0: std::panicking::begin_panic
1: std::panic::panic_any
2: rustc_errors::HandlerInner::bug
3: rustc_errors::Handler::bug
4: rustc_middle::ty::context::tls::with_opt
5: rustc_middle::util::bug::opt_span_bug_fmt
6: rustc_middle::util::bug::bug_fmt
7: rustc_metadata::rmeta::decoder::::get_adt_def
8: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::adt_def
9: rustc_middle::dep_graph::::with_deps
10: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
11: rustc_query_system::dep_graph::graph::DepGraph::with_task
12: rustc_data_structures::stack::ensure_sufficient_stack
13: rustc_query_system::query::plumbing::force_query_with_job
14: rustc_query_system::query::plumbing::force_query_impl
15: rustc_middle::dep_graph::dep_node::dep_kind::adt_def::force_from_dep_node
16: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
17: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
18: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
19: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
20: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
21: rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green
22: rustc_query_system::dep_graph::graph::DepGraph::try_mark_green_and_read
23: rustc_data_structures::stack::ensure_sufficient_stack
24: rustc_query_system::query::plumbing::get_query_impl
25: ::evaluate_obligation
26: ::evaluate_obligation_no_overflow
27: rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation
28: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
29: ::select_where_possible
30: ::select_all_or_error
31: rustc_trait_selection::traits::codegen::drain_fulfillment_cx_or_panic
32: rustc_infer::infer::InferCtxtBuilder::enter
33: rustc_trait_selection::traits::codegen::codegen_fulfill_obligation
34: rustc_middle::ty::query:: for rustc_middle::ty::query::queries::codegen_fulfill_obligation>::compute
35: rustc_middle::dep_graph::::with_deps
36: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
37: rustc_data_structures::stack::ensure_sufficient_stack
38: rustc_query_system::query::plumbing::force_query_with_job
39: rustc_query_system::query::plumbing::get_query_impl
40: rustc_ty_utils::instance::inner_resolve_instance
41: rustc_ty_utils::instance::resolve_instance
42: rustc_middle::ty::query:: for rustc_middle::ty::query::queries::resolve_instance>::compute
43: rustc_middle::dep_graph::::with_deps
44: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
45: rustc_data_structures::stack::ensure_sufficient_stack
46: rustc_query_system::query::plumbing::force_query_with_job
47: rustc_query_system::query::plumbing::get_query_impl
48: rustc_middle::ty::instance::Instance::resolve_opt_const_arg
49: rustc_middle::ty::instance::Instance::resolve
50: ::visit_terminator
51: rustc_mir::monomorphize::collector::collect_neighbours
52: rustc_mir::monomorphize::collector::collect_items_rec
53: rustc_mir::monomorphize::collector::collect_items_rec
54: rustc_mir::monomorphize::collector::collect_items_rec
55: rustc_mir::monomorphize::collector::collect_items_rec
56: rustc_mir::monomorphize::collector::collect_items_rec
57: rustc_mir::monomorphize::collector::collect_items_rec
58: rustc_mir::monomorphize::collector::collect_items_rec
59: rustc_mir::monomorphize::collector::collect_items_rec
60: rustc_session::utils::::time
61: rustc_mir::monomorphize::collector::collect_crate_mono_items
62: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
63: rustc_middle::ty::query:: for rustc_middle::ty::query::queries::collect_and_partition_mono_items>::compute
64: rustc_middle::dep_graph::::with_deps
65: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
66: rustc_data_structures::stack::ensure_sufficient_stack
67: rustc_query_system::query::plumbing::force_query_with_job
68: rustc_query_system::query::plumbing::get_query_impl
69: rustc_codegen_ssa::base::codegen_crate
70: ::codegen_crate
71: rustc_session::utils::::time
72: rustc_interface::passes::QueryContext::enter
73: rustc_interface::queries::Queries::ongoing_codegen
74: rustc_interface::queries::::enter
75: rustc_span::with_source_map
76: rustc_interface::interface::create_compiler_and_run
77: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.51.0 (2fd73fabe 2021-03-23) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [adt_def] computing ADT definition for `traitgraph::walks::VecNodeWalk`
#1 [evaluate_obligation] evaluating trait selection obligation `std::iter::Map>>, [closure@omnitigs/src/macrotigs/macronodes/strongly_connected_macronode_algorithm.rs:14:21: 18:14]>, fn(unitigs::NodeUnitig>) -> std::vec::Vec< as traitgraph::interface::GraphBase>::NodeIndex> {unitigs::NodeUnitig::>::into_node_walk}>: std::vec::source_iter_marker::SourceIterMarker`
#2 [codegen_fulfill_obligation] checking if `std::vec::spec_from_iter::SpecFromIter` fulfills its obligations
#3 [resolve_instance] resolving instance `>> as std::vec::spec_from_iter::SpecFromIter>, std::iter::Map>>, [closure@omnitigs/src/macrotigs/macronodes/strongly_connected_macronode_algorithm.rs:14:21: 18:14]>, fn(unitigs::NodeUnitig>) -> std::vec::Vec< as traitgraph::interface::GraphBase>::NodeIndex> {unitigs::NodeUnitig::>::into_node_walk}>>>::from_iter`
#4 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error; 2 warnings emitted
error: could not compile `omnitigs`
To learn more, run the command again with --verbose.
```
What I tried
cargo update
as of today updated the dependencies to a state that seem to circumvent the ICE.Without the cargo update, using beta the ICE does not occur.
Also without the cargo update, using nightly the ICE does not occur.
What solved it
Deleting the target folder (after reverting the cargo update) fixed the ICE. I could then run
cargo test
again and no ICE occurred.I might have clicked the test button too fast in my IDE while debugging, so possibly cargo was run concurrently.