Open tylerhawkes opened 2 years ago
I just rsync'd the code to an aws graviton instance (haven't done the work to cross-compile on my m1) and ran into the exact same issue on the other machine that had previously built the exact same code. This is using the stable compiler on aarch64-unknown-linux-gnu.
```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:85
stack backtrace:
0: rust_begin_unwind
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
2: core::panicking::panic
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:48:5
3:
Turns out this is kind of reproducible. I just got a panic in a test crate and then compiled a crate that depends on on the library that generates code and ended up with this stack trace. They looked identical. All I did was rename some fields and a struct in the derived code.
```
thread 'rustc' panicked at 'Failed to extract DefId: local_def_id_to_hir_id a0695fa769b73be4-41ed76b2573fb53e', compiler/rustc_middle/src/dep_graph/dep_node.rs:267:17
stack backtrace:
0: 0x10513f774 -
@rustbot label +A-incr-comp
Possibly related: https://github.com/rust-lang/rust/issues/102739
Code
Unfortunately, this is probably an incremental compilation issue, so probably not reproducible. This is the 3rd time I've run into this in the last day.
cargo clean -p <my-crate>
seems to fix it. The previous issues were also withSend
andSync
so it appears to be an issue with resolving auto traits. TheUserComparison
struct is auto generated by a proc-macro that had changes made to it.Meta
rustc --version --verbose
:Error output
This is everything except the stack trace
Backtrace
``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:62 stack backtrace: 0: 0x101563774 -::fmt::hc14c2fbe7eab7edd
1: 0x1015adca4 - core::fmt::write::hf7ba2d9322b02f7b
2: 0x101556714 - std::io::Write::write_fmt::hcbbe9804d68b1866
3: 0x101565ff0 - std::panicking::default_hook::{{closure}}::h074c918006a712d7
4: 0x101565d14 - std::panicking::default_hook::hcb4fc0515f47d0e1
5: 0x1092d5c74 - rustc_driver[51b00cac61f89616]::DEFAULT_HOOK::{closure#0}::{closure#0}
6: 0x1015666b4 - std::panicking::rust_panic_with_hook::hda85dfcaf11e28f6
7: 0x101566524 - std::panicking::begin_panic_handler::{{closure}}::hacac2c8511d70f3d
8: 0x101563bdc - std::sys_common::backtrace::__rust_end_short_backtrace::h1f4cf35d9dc62d33
9: 0x1015662b4 - _rust_begin_unwind
10: 0x1015d7714 - core::panicking::panic_fmt::h7cea19b1cbddf8d1
11: 0x1015d7634 - core::panicking::panic::h231bcc5267006a51
12: 0x10c87adb8 - ::def_path_hash_to_def_id
13: 0x10cf8f3ec - ::def_path_hash_to_def_id
14: 0x10cfb4e4c - as rustc_middle[6ad8a970aa6bf88a]::dep_graph::dep_node::DepNodeExt>::extract_def_id
15: 0x10c51dfa0 - rustc_query_impl[bef29f7fed8c56d5]::plumbing::force_from_dep_node::
16: 0x10cf7aef4 - ::try_force_from_dep_node
17: 0x10c472cbc - >::try_mark_previous_green::
18: 0x10c472c8c - >::try_mark_previous_green::
19: 0x10c472c8c - >::try_mark_previous_green::
20: 0x10c472c8c - >::try_mark_previous_green::
21: 0x10c443108 - >::try_mark_green::
22: 0x10c2dcb18 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::try_load_from_disk_and_cache_in_memory::>, core[7341f3703d0d347b]::result::Result>
23: 0x10c245038 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::try_execute_query::>, core[7341f3703d0d347b]::result::Result>>
24: 0x10c30c214 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::get_query::
25: 0x10c56c008 - ::evaluate_obligation
26: 0x10cc98b2c - ::evaluate_obligation
27: 0x10cc98c14 - ::evaluate_obligation_no_overflow
28: 0x10cd4a8fc - ::process_trait_obligation
29: 0x10cd4a3d8 - ::process_obligation
30: 0x10cd0a918 - >::process_obligations::>
31: 0x10cd45d3c - ::select_where_possible
32: 0x10cd45c5c - ::select_all_or_error
33: 0x10cd45214 - ::select_all_or_error
34: 0x10ba8445c - ::enter::<(), rustc_typeck[a5d00582971cd053]::check::wfcheck::enter_wf_checking_ctxt::{closure#0}>
35: 0x10ba38718 - rustc_typeck[a5d00582971cd053]::check::wfcheck::check_well_formed
36: 0x10c486344 - >::with_task::
37: 0x10c25fa88 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::try_execute_query::>
38: 0x10c30992c - rustc_query_system[f65373cf6a3466fe]::query::plumbing::get_query::
39: 0x10b9d9dec - rustc_data_structures[309676ed709479c3]::sync::par_for_each_in::<&[rustc_hir[f788c0200d65aab0]::hir::ItemId], ::par_items::{closure#0}>
40: 0x10ba3e768 - rustc_typeck[a5d00582971cd053]::check::wfcheck::check_mod_type_wf
41: 0x10c486344 - >::with_task::
42: 0x10c25fa88 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::try_execute_query::>
43: 0x10c3097f0 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::get_query::
44: 0x10b9d9a5c - rustc_data_structures[309676ed709479c3]::sync::par_for_each_in::<&[rustc_span[81520514b41fb732]::def_id::LocalDefId], ::par_for_each_module::{closure#0}>
45: 0x10b9863d8 - ::track_errors::
46: 0x10baa5acc - rustc_typeck[a5d00582971cd053]::check_crate
47: 0x1093e6830 - rustc_interface[2fa9866cf3cf12fa]::passes::analysis
48: 0x10c4a87dc - >::with_task::>
49: 0x10c2b52d0 - rustc_query_system[f65373cf6a3466fe]::query::plumbing::try_execute_query::>>
50: 0x10c31c92c - rustc_query_system[f65373cf6a3466fe]::query::plumbing::get_query::
51: 0x1093066f0 - ::enter::>
52: 0x1092db704 - rustc_interface[2fa9866cf3cf12fa]::interface::create_compiler_and_run::, rustc_driver[51b00cac61f89616]::run_compiler::{closure#1}>
53: 0x1093407d4 - >::set::, rustc_driver[51b00cac61f89616]::run_compiler::{closure#1}>::{closure#0}, core[7341f3703d0d347b]::result::Result<(), rustc_errors[e87086a6cb9e4ec1]::ErrorGuaranteed>>
54: 0x10930a464 - std[65493a5d9e125887]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[51b00cac61f89616]::run_compiler::{closure#1}>::{closure#0}, core[7341f3703d0d347b]::result::Result<(), rustc_errors[e87086a6cb9e4ec1]::ErrorGuaranteed>>::{closure#0}, core[7341f3703d0d347b]::result::Result<(), rustc_errors[e87086a6cb9e4ec1]::ErrorGuaranteed>>
55: 0x10930d2e8 - <::spawn_unchecked_, rustc_driver[51b00cac61f89616]::run_compiler::{closure#1}>::{closure#0}, core[7341f3703d0d347b]::result::Result<(), rustc_errors[e87086a6cb9e4ec1]::ErrorGuaranteed>>::{closure#0}, core[7341f3703d0d347b]::result::Result<(), rustc_errors[e87086a6cb9e4ec1]::ErrorGuaranteed>>::{closure#1} as core[7341f3703d0d347b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
56: 0x10156e550 - std::sys::unix::thread::Thread::new::thread_start::h24b04cb1ad6e937f
57: 0x1870a426c - __pthread_deallocate
```