I hit a panic while compiling and the output asked me to create a bug report. I'm compiling company-owned source code so can't provide that, but I'm ok to provide all the output that happened on the command line. I hope that's enough to make rust better somehow.
Description of steps
I made a change in our source code by running diesel migration run.
Then I wanted to recompile the project so I issued cargo build and saw the issue described below under "Error output"
It's easy to reproduce by repeating cargo build
Next I ran cargo clean (Removed 89831 files, 85.1GiB total)
After that, RUST_BACKTRACE=1 cargo build succeeded
So this was a transitory thing, and isn't a problem for me, but I thought I'd report in the interests of gathering data.
I hit a panic while compiling and the output asked me to create a bug report. I'm compiling company-owned source code so can't provide that, but I'm ok to provide all the output that happened on the command line. I hope that's enough to make rust better somehow.
Description of steps
diesel migration run
.cargo build
and saw the issue described below under "Error output"cargo build
cargo clean
(Removed 89831 files, 85.1GiB total
)RUST_BACKTRACE=1 cargo build
succeededSo this was a transitory thing, and isn't a problem for me, but I thought I'd report in the interests of gathering data.
Code
(can't provide, sorry)
Meta
rustc --version --verbose
:Error output
Backtrace
``` >$ RUST_BACKTRACE=1 cargo build Compiling spore-db-impl v0.1.0 (/Users/richard.morrison/src/mushroom/services/spore/spore-db-impl) thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:22:85: called `Option::unwrap()` on a `None` value stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic 3:::def_path_hash_to_def_id
4: ::def_path_hash_to_def_id
5: ::extract_def_id
6: ::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode)>>::call_once
7: >::try_mark_previous_green::
8: >::try_mark_previous_green::
9: >::try_mark_previous_green::
10: >::try_mark_previous_green::
11: >::try_mark_previous_green::
12: >::try_mark_previous_green::
13: >::try_mark_previous_green::
14: >::try_mark_green::
15: rustc_query_system::query::plumbing::try_execute_query::>, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
16: ::perform_query
17: ::fully_perform_into
18: ::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd>
19: ::normalize_and_prove_instantiated_predicates
20: ::visit_constant
21: ::visit_body
22: rustc_borrowck::type_check::type_check
23: rustc_borrowck::nll::compute_regions
24: rustc_borrowck::do_mir_borrowck
25: rustc_borrowck::mir_borrowck
[... omitted 13 frames ...]
26: ::for_each_module::
27: rustc_hir_analysis::check_crate
28: rustc_interface::passes::analysis
[... omitted 2 frames ...]
29: ::enter::>
30: ::enter::, rustc_span::ErrorGuaranteed>>
31: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
32: >::set::, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
33: rustc_span::create_session_globals_then::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: 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.76.0 (07dca489a 2024-02-04) (built from a source tarball) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [type_op_prove_predicate] evaluating `type_op_prove_predicate` `ProvePredicate { predicate: Binder { value: TraitPredicate(, diesel::expression::bound::Bound>, diesel::query_builder::update_statement::changeset::Assign, diesel::expression::bound::Bound>>)> as diesel::query_builder::AsQuery>, polarity:Positive), bound_vars: [] } }`
#1 [mir_borrowck] borrow-checking `storage::terms_document::::update_document::{closure#0}::{closure#0}::{closure#0}`
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 adt_sized_constraint(thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:22:85:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: ::def_path_hash_to_def_id
4: ::def_path_hash_to_def_id
5: ::extract_def_id
6: rustc_interface::callbacks::dep_node_debug
7: ::fmt
8: core::fmt::write
9: <&std::io::stdio::Stderr as std::io::Write>::write_fmt
10: std::io::stdio::_eprint
11: rustc_query_system::dep_graph::graph::print_markframe_trace::
12: >::try_mark_previous_green::
13: >::try_mark_previous_green::
14: >::try_mark_previous_green::
15: >::try_mark_previous_green::
16: >::try_mark_previous_green::
17: >::try_mark_previous_green::
18: >::try_mark_previous_green::
19: >::try_mark_green::
20: rustc_query_system::query::plumbing::try_execute_query::>, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
21: ::perform_query
22: ::fully_perform_into
23: ::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd>
24: ::normalize_and_prove_instantiated_predicates
25: ::visit_constant
26: ::visit_body
27: rustc_borrowck::type_check::type_check
28: rustc_borrowck::nll::compute_regions
29: rustc_borrowck::do_mir_borrowck
30: rustc_borrowck::mir_borrowck
[... omitted 13 frames ...]
31: ::for_each_module::
32: rustc_hir_analysis::check_crate
33: rustc_interface::passes::analysis
[... omitted 2 frames ...]
34: ::enter::>
35: ::enter::, rustc_span::ErrorGuaranteed>>
36: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
37: >::set::, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
38: rustc_span::create_session_globals_then::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: 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.76.0 (07dca489a 2024-02-04) (built from a source tarball) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [type_op_prove_predicate] evaluating `type_op_prove_predicate` `ProvePredicate { predicate: Binder { value: TraitPredicate(, diesel::expression::bound::Bound>, diesel::query_builder::update_statement::changeset::Assign, diesel::expression::bound::Bound>>)> as diesel::query_builder::AsQuery>, polarity:Positive), bound_vars: [] } }`
#1 [mir_borrowck] borrow-checking `storage::terms_document::::update_document::{closure#0}::{closure#0}::{closure#0}`
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 mir_borrowck(spore_db_impl[2b51]::storage::terms_document::{impl#0}::update_document::{closure#0}::{closure#0})
#1 mir_borrowck(spore_db_impl[2b51]::storage::terms_document::{impl#0}::update_document::{closure#0})
#2 mir_borrowck(spore_db_impl[2b51]::storage::terms_document::{impl#0}::update_document)
#3 type_of_opaque(spore_db_impl[2b51]::storage::terms_document::{impl#0}::update_document::{opaque#0})
#4 collect_return_position_impl_trait_in_trait_tys(spore_db_impl[2b51]::storage::terms_document::{impl#0}::update_document)
#5 type_of(spore_db_impl[2b51]::storage::terms_document::{impl#0}::{opaque#4})
#6 check_mod_impl_wf(spore_db_impl[2b51]::storage::terms_document)
end of try_mark_green dep node stack
error: could not compile `spore-db-impl` (lib)
```