Open That3Percent opened 2 years ago
Are you able to reproduce this after running cargo clean
by repeating the modifications and cargo build
invocations that you made?
Not author but I encountered this twice already when compiling rust-analyzer. Always with incremental compilation, cleaning and rebuilding fixes the problem
Looks like duplicate of ~50 other issues - https://github.com/rust-lang/rust/issues?page=1&q=is%3Aissue+is%3Aopen+def_path_hash_to_def_id
While this issue is related, it might not be a duplicate
Mostly seems like an incremental build problem, yeah -- cargo clean
and rebuilding should fix it.
Sorry for the belated reply. I'm swamped at work and unable to investigate further. I can confirm though that cleaning and rebuilding did solve the issue.
Note: This may have something to do with incremental compilation. I had just moved a struct to another file, and some code which should not have passed cargo check because it referenced that struct by the old path still compiled. Only after I saved the file referencing the invalid path with the fixed path did the panic occur.
Code
This commit: https://github.com/graphprotocol/stable-hash/commit/ea3b6beedfac362f55393004c59ee60e72ee045c
Meta
rustc --version --verbose
:Error output
Backtrace
``` 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: as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
6: rustc_query_impl::query_callbacks::adt_def::force_from_dep_node
7: ::try_force_from_dep_node
8: >::try_mark_previous_green::
9: >::try_mark_green::
10: rustc_query_system::query::plumbing::ensure_must_run::
11: rustc_query_system::query::plumbing::get_query::
12: ::for_each_module::
13: ::time::<(), rustc_interface::passes::analysis::{closure#1}>
14: rustc_interface::passes::analysis
15: >::with_task::>
16: rustc_data_structures::stack::ensure_sufficient_stack::<(core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job>::{closure#3}>
17: rustc_query_system::query::plumbing::try_execute_query::>>
18: ::analysis
19: ::enter::>
20: ::enter::, rustc_errors::ErrorReported>>
21: rustc_span::with_source_map::, rustc_interface::interface::create_compiler_and_run, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
22: >::set::, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
```