rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.02k stars 12.68k forks source link

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:22:85 #120474

Open keepsimple1 opened 9 months ago

keepsimple1 commented 9 months ago

Meta

rustc 1.75.0 (82e1608df 2023-12-21) running on x86_64-apple-darwin

Error output

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:22:85:
called `Option::unwrap()` on a `None` value
Backtrace

``` stack backtrace: 0: 0x10e2cd40b - ::fmt::h958f6e6821e9b0fb 1: 0x10e319b43 - core::fmt::write::hb5e3c29742bab55e 2: 0x10e2c379e - std::io::Write::write_fmt::h3f38404afa442946 3: 0x10e2cd1e9 - std::sys_common::backtrace::print::h1ce04ba6121a0174 4: 0x10e2d03b5 - std::panicking::default_hook::{{closure}}::hf2e5fe71523bcace 5: 0x10e2d0134 - std::panicking::default_hook::h4f8cdc98d2dcc8c0 6: 0x11981125e - as core[7d2d2f04a0a3cf2a]::ops::function::Fn<(&dyn for<'a, 'b> core[7d2d2f04a0a3cf2a]::ops::function::Fn<(&'a core[7d2d2f04a0a3cf2a]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[7d2d2f04a0a3cf2a]::marker::Send + core[7d2d2f04a0a3cf2a]::marker::Sync, &core[7d2d2f04a0a3cf2a]::panic::panic_info::PanicInfo)>>::call 7: 0x10e2d0a55 - std::panicking::rust_panic_with_hook::h28420d44f043d3a5 8: 0x10e2d07bc - std::panicking::begin_panic_handler::{{closure}}::h6f886c0e89185cdc 9: 0x10e2cd8e9 - std::sys_common::backtrace::__rust_end_short_backtrace::h7ca2b2ff22d46410 10: 0x10e2d0542 - _rust_begin_unwind 11: 0x10e335bd5 - core::panicking::panic_fmt::h52dad7a658d9bf41 12: 0x10e335c67 - core::panicking::panic::ha1c871ecc7d4b1cb 13: 0x11a1a9b08 - ::def_path_hash_to_def_id 14: 0x11a38b509 - ::def_path_hash_to_def_id 15: 0x11ac1b871 - ::{closure#0} as core[7d2d2f04a0a3cf2a]::ops::function::FnOnce<(rustc_middle[44406bf613825fc6]::ty::context::TyCtxt, rustc_query_system[d58496f053c0d289]::dep_graph::dep_node::DepNode)>>::call_once 16: 0x11ac83f22 - >::try_mark_previous_green:: 17: 0x11ac83f84 - >::try_mark_previous_green:: 18: 0x11ac83f84 - >::try_mark_previous_green:: 19: 0x11ac83ca6 - >::try_mark_green:: 20: 0x11ab918ce - rustc_query_system[d58496f053c0d289]::query::plumbing::try_execute_query::>, rustc_middle[44406bf613825fc6]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::QueryCtxt, true> 21: 0x11acf61e2 - rustc_query_impl[f8a79d08ba0ddcf9]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace 22: 0x11b33e176 - ::evaluate_obligation 23: 0x11b33e45f - ::evaluate_obligation_no_overflow 24: 0x11b2a8605 - ::process_trait_obligation 25: 0x11b2a72a3 - ::process_obligation 26: 0x11b15cc33 - >::process_obligations:: 27: 0x11b29737f - ::select_where_possible 28: 0x119c5da79 - ::check_argument_types 29: 0x119c33c7d - ::confirm_builtin_call 30: 0x119c32411 - ::check_call 31: 0x119cb2532 - ::check_expr_kind 32: 0x119c43c3a - ::check_expr_with_expectation_and_args 33: 0x119cb2594 - ::check_expr_kind 34: 0x119c43c3a - ::check_expr_with_expectation_and_args 35: 0x119c66661 - ::check_stmt 36: 0x119c66d7c - ::check_block_with_expected 37: 0x119c43c3a - ::check_expr_with_expectation_and_args 38: 0x119cb58d1 - ::check_expr_kind 39: 0x119c43c3a - ::check_expr_with_expectation_and_args 40: 0x119c66539 - ::check_stmt 41: 0x119c66d7c - ::check_block_with_expected 42: 0x119c43c3a - ::check_expr_with_expectation_and_args 43: 0x119c43c3a - ::check_expr_with_expectation_and_args 44: 0x119c66dae - ::check_block_with_expected 45: 0x119c43c3a - ::check_expr_with_expectation_and_args 46: 0x119c451dd - ::check_return_expr 47: 0x119dfa8a6 - rustc_hir_typeck[893aad13a1ca7d85]::check::check_fn 48: 0x119cae96a - ::check_expr_closure 49: 0x119c43c3a - ::check_expr_with_expectation_and_args 50: 0x119c451dd - ::check_return_expr 51: 0x119dfa8a6 - rustc_hir_typeck[893aad13a1ca7d85]::check::check_fn 52: 0x119de6fd2 - rustc_hir_typeck[893aad13a1ca7d85]::typeck 53: 0x11ac3916f - rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::__rust_begin_short_backtrace::> 54: 0x11adbe00c - >::call_once 55: 0x11abfb8e1 - rustc_query_system[d58496f053c0d289]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::QueryCtxt, true> 56: 0x11ab78268 - rustc_query_system[d58496f053c0d289]::query::plumbing::force_query::>, false, false, false>, rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::QueryCtxt> 57: 0x11ac1b571 - ::{closure#0} as core[7d2d2f04a0a3cf2a]::ops::function::FnOnce<(rustc_middle[44406bf613825fc6]::ty::context::TyCtxt, rustc_query_system[d58496f053c0d289]::dep_graph::dep_node::DepNode)>>::call_once 58: 0x11ac83f22 - >::try_mark_previous_green:: 59: 0x11ac83f84 - >::try_mark_previous_green:: 60: 0x11ac83f84 - >::try_mark_previous_green:: 61: 0x11ac83ca6 - >::try_mark_green:: 62: 0x11ab7a76d - rustc_query_system[d58496f053c0d289]::query::plumbing::ensure_must_run::>, false, false, false>, rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::QueryCtxt> 63: 0x11acd6806 - rustc_query_impl[f8a79d08ba0ddcf9]::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace 64: 0x119ba9549 - rustc_hir_analysis[36207a74c89996d6]::check_crate 65: 0x11a003270 - rustc_interface[af6ebd27ce945bf]::passes::analysis 66: 0x11ac391ed - rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::__rust_begin_short_backtrace::> 67: 0x11ad30b39 - >::call_once 68: 0x11ab82089 - rustc_query_system[d58496f053c0d289]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[f8a79d08ba0ddcf9]::plumbing::QueryCtxt, true> 69: 0x11acc6c94 - rustc_query_impl[f8a79d08ba0ddcf9]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace 70: 0x1197ee8d1 - ::enter::> 71: 0x1197ed11a - rustc_span[ced6024ceb03e466]::set_source_map::, rustc_interface[af6ebd27ce945bf]::interface::run_compiler, rustc_driver_impl[5b49da1f7667149]::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 72: 0x1197b5fec - >::set::, rustc_driver_impl[5b49da1f7667149]::run_compiler::{closure#1}>::{closure#0}, core[7d2d2f04a0a3cf2a]::result::Result<(), rustc_span[ced6024ceb03e466]::ErrorGuaranteed>> 73: 0x1197ee1fe - rustc_span[ced6024ceb03e466]::create_session_globals_then::, rustc_interface[af6ebd27ce945bf]::interface::run_compiler, rustc_driver_impl[5b49da1f7667149]::run_compiler::{closure#1}>::{closure#0}> 74: 0x1197e6c75 - std[69f244de2863e905]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[5b49da1f7667149]::run_compiler::{closure#1}>::{closure#0}, core[7d2d2f04a0a3cf2a]::result::Result<(), rustc_span[ced6024ceb03e466]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d2d2f04a0a3cf2a]::result::Result<(), rustc_span[ced6024ceb03e466]::ErrorGuaranteed>> 75: 0x1197bfede - <::spawn_unchecked_, rustc_driver_impl[5b49da1f7667149]::run_compiler::{closure#1}>::{closure#0}, core[7d2d2f04a0a3cf2a]::result::Result<(), rustc_span[ced6024ceb03e466]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d2d2f04a0a3cf2a]::result::Result<(), rustc_span[ced6024ceb03e466]::ErrorGuaranteed>>::{closure#1} as core[7d2d2f04a0a3cf2a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 76: 0x10e2d9d79 - std::sys::unix::thread::Thread::new::thread_start::hc4d1a801e7d23b95 77: 0x7ff81dbab4e1 - __pthread_start error: the compiler unexpectedly panicked. this is a bug. ```

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED] -C target-cpu=native

clubby789 commented 9 months ago

Can you provide a minimal example that reproduces this issue? And does it persist after cargo clean?

keepsimple1 commented 9 months ago

Sorry I was not able to come up with a minimal example to reproduce. The problem is gone after I did cargo clean.