rust-lang / rust

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

Internal Compiler Error when trying to compile a small project (only dependency: clap) #130103

Closed jullanggit closed 1 month ago

jullanggit commented 1 month ago

rustc-ice-2024-09-08T14_54_35-21855.txt

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (12b26c13f 2024-09-07)
binary: rustc
commit-hash: 12b26c13fba25c9e1bc2fdf05f3c2dbb851c83de
commit-date: 2024-09-07
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Error output

thread 'rustc' panicked at /rustc/12b26c13fba25c9e1bc2fdf05f3c2dbb851c83de/compiler/rustc_type_ir/src/search_graph/global_cache.rs:62:13:
assertion failed: prev.is_none()

error: the compiler unexpectedly panicked. this is a bug.

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -Z threads=12 -Z share-generics=y -Z macro-backtrace -C target-cpu=native -C linker=clang -C link-arg=-fuse-ld=/usr/bin/mold -Z threads=12 -Z share-generics=y -Z macro-backtrace -C target-cpu=native -C linker=clang -C link-arg=-fuse-ld=/usr/bin/mold

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `core::cmp::PartialEq`
#1 [coherent_trait] coherence checking all impls of trait `core::cmp::PartialEq`
end of query stack
error: could not compile `utf8parse` (lib)

Caused by:
  process didn't exit successfully: `/home/julius/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name utf8parse --edition=2018 /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/utf8parse-0.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=111 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("default", "nightly"))' -C metadata=d435e47da5544871 -C extra-filename=-d435e47da5544871 --out-dir /home/julius/.config/rebos/files/common/home/julius/Code/rust/huffman/target/debug/deps -L dependency=/home/julius/.config/rebos/files/common/home/julius/Code/rust/huffman/target/debug/deps --cap-lints allow -Zthreads=12 -Zshare-generics=y -Zmacro-backtrace -Ctarget-cpu=native -Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold '-Wclippy::complexity' '-Wclippy::correctness' '-Wclippy::pedantic' '-Wclippy::nursery' '-Wclippy::perf' '-Wclippy::style' '-Wclippy::suspicious' '-Wclippy::allow_attributes' '-Wclippy::clone_on_ref_ptr' '-Wclippy::empty_enum_variants_with_brackets' '-Wclippy::empty_structs_with_brackets' '-Wclippy::filetype_is_file' '-Wclippy::fn_to_numeric_cast_any' '-Wclippy::format_push_string' '-Wclippy::get_unwrap' '-Wclippy::if_then_some_else_none' '-Wclippy::infinite_loop' '-Wclippy::integer_division' '-Wclippy::let_underscore_must_use' '-Wclippy::lossy_float_literal' '-Wclippy::multiple_inherent_impl' '-Wclippy::multiple_unsafe_ops_per_block' '-Wclippy::mutex_atomic' '-Wclippy::pattern_type_mismatch' '-Wclippy::rc_buffer' '-Wclippy::rc_mutex' '-Wclippy::redundant_type_annotations' '-Wclippy::renamed_function_params' '-Wclippy::rest_pat_in_fully_bound_structs' '-Wclippy::same_name_method' '-Wclippy::semicolon_inside_block' '-Wclippy::str_to_string' '-Wclippy::string_add' '-Wclippy::string_slice' '-Wclippy::string_to_string' '-Wclippy::try_err' '-Wclippy::undocumented_unsafe_blocks' '-Wclippy::unneeded_field_pattern' '-Wclippy::unseparated_literal_suffix' '-Wclippy::verbose_file_reads' '-Wclippy::wildcard_enum_match_arm' -Zthreads=12 -Zshare-generics=y -Zmacro-backtrace -Ctarget-cpu=native -Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold '-Wclippy::complexity' '-Wclippy::correctness' '-Wclippy::pedantic' '-Wclippy::nursery' '-Wclippy::perf' '-Wclippy::style' '-Wclippy::suspicious' '-Wclippy::allow_attributes' '-Wclippy::clone_on_ref_ptr' '-Wclippy::empty_enum_variants_with_brackets' '-Wclippy::empty_structs_with_brackets' '-Wclippy::filetype_is_file' '-Wclippy::fn_to_numeric_cast_any' '-Wclippy::format_push_string' '-Wclippy::get_unwrap' '-Wclippy::if_then_some_else_none' '-Wclippy::infinite_loop' '-Wclippy::integer_division' '-Wclippy::let_underscore_must_use' '-Wclippy::lossy_float_literal' '-Wclippy::multiple_inherent_impl' '-Wclippy::multiple_unsafe_ops_per_block' '-Wclippy::mutex_atomic' '-Wclippy::pattern_type_mismatch' '-Wclippy::rc_buffer' '-Wclippy::rc_mutex' '-Wclippy::redundant_type_annotations' '-Wclippy::renamed_function_params' '-Wclippy::rest_pat_in_fully_bound_structs' '-Wclippy::same_name_method' '-Wclippy::semicolon_inside_block' '-Wclippy::str_to_string' '-Wclippy::string_add' '-Wclippy::string_slice' '-Wclippy::string_to_string' '-Wclippy::try_err' '-Wclippy::undocumented_unsafe_blocks' '-Wclippy::unneeded_field_pattern' '-Wclippy::unseparated_literal_suffix' '-Wclippy::verbose_file_reads' '-Wclippy::wildcard_enum_match_arm'` (exit status: 101)
Backtrace

``` stack backtrace: 0: 0x7b50d386ed7a - ::fmt::had40ff6b0d363d8c 1: 0x7b50d40038d7 - core::fmt::write::h8896cd9c17192606 2: 0x7b50d4fd6991 - std::io::Write::write_fmt::h2513a98e60324138 3: 0x7b50d386ebd2 - std::sys::backtrace::BacktraceLock::print::h97ff941b8ca3ca17 4: 0x7b50d38710f1 - std::panicking::default_hook::{{closure}}::h1240f9059a722e94 5: 0x7b50d3870f24 - std::panicking::default_hook::hef1ed95231316e5f 6: 0x7b50d2987a9f - std[484d8c24ec532d56]::panicking::update_hook::>::{closure#0} 7: 0x7b50d3871818 - std::panicking::rust_panic_with_hook::ha3e00c002dd0b838 8: 0x7b50d38715b3 - std::panicking::begin_panic_handler::{{closure}}::h3edbee652d640d30 9: 0x7b50d386f229 - std::sys::backtrace::__rust_end_short_backtrace::h445f0cc1cf5517d2 10: 0x7b50d38712b4 - rust_begin_unwind 11: 0x7b50d069ef93 - core::panicking::panic_fmt::hf21bdc4a13d5d028 12: 0x7b50d086afac - core::panicking::panic::hca0b284a346aa581 13: 0x7b50d4c6aa0e - , rustc_middle[da941fcb4ea689b5]::ty::context::TyCtxt>>::insert_global_cache::{closure#0} 14: 0x7b50d4c6b883 - , rustc_middle[da941fcb4ea689b5]::ty::context::TyCtxt>>::with_new_goal::<>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}> 15: 0x7b50d4c7189a - >::evaluate_goal_raw 16: 0x7b50d4c6ff23 - as rustc_infer[7e4ed2eac6f0a6fc]::traits::engine::TraitEngine>::select_where_possible 17: 0x7b50d4c6fa77 - as rustc_infer[7e4ed2eac6f0a6fc]::traits::engine::TraitEngine>::select_all_or_error 18: 0x7b50d490d4ad - rustc_trait_selection[5d67302665ab6be6]::traits::coherence::overlap 19: 0x7b50d12ac0d8 - ::insert 20: 0x7b50d12a9752 - ::insert 21: 0x7b50d431c3f4 - rustc_trait_selection[5d67302665ab6be6]::traits::specialize::specialization_graph_provider 22: 0x7b50d431bd65 - rustc_query_impl[a6b34b6c656310e8]::plumbing::__rust_begin_short_backtrace::> 23: 0x7b50d40290fc - rustc_query_system[43367dc2cdf302c7]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a6b34b6c656310e8]::plumbing::QueryCtxt, false> 24: 0x7b50d45be4f6 - rustc_query_impl[a6b34b6c656310e8]::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace 25: 0x7b50d4c306c3 - rustc_hir_analysis[6ffe0ea406cdfc5e]::coherence::coherent_trait 26: 0x7b50d4c303d5 - rustc_query_impl[a6b34b6c656310e8]::plumbing::__rust_begin_short_backtrace::> 27: 0x7b50d44c3b50 - rustc_query_system[43367dc2cdf302c7]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a6b34b6c656310e8]::plumbing::QueryCtxt, false> 28: 0x7b50d44c2923 - rustc_query_impl[a6b34b6c656310e8]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace 29: 0x7b50d159a795 - rustc_hir_analysis[6ffe0ea406cdfc5e]::check::wfcheck::check_well_formed 30: 0x7b50d454be07 - rustc_query_impl[a6b34b6c656310e8]::plumbing::__rust_begin_short_backtrace::> 31: 0x7b50d454c07e - rustc_query_system[43367dc2cdf302c7]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a6b34b6c656310e8]::plumbing::QueryCtxt, false> 32: 0x7b50d454bde2 - rustc_query_impl[a6b34b6c656310e8]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace 33: 0x7b50d454bd3d - rustc_middle[da941fcb4ea689b5]::query::plumbing::query_ensure_error_guaranteed::>, ()> 34: 0x7b50d2a88aa9 - rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper::, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>> 35: 0x7b50d2ab12df - rayon_core[d62d1a8c2a76ce74]::join::join_context::, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>>::{closure#0} 36: 0x7b50d2a88cbc - rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper::, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>> 37: 0x7b50d2ab12df - rayon_core[d62d1a8c2a76ce74]::join::join_context::, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>>::{closure#0} 38: 0x7b50d2a88cbc - rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper::, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>> 39: 0x7b50d2ae64e2 - , rayon[50230965afff542b]::iter::plumbing::bridge_producer_consumer::helper, rayon[50230965afff542b]::iter::filter_map::FilterMapConsumer>::and<()>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#1}>, rustc_data_structures[75560fe33d5b6f5e]::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir[e105a3e4adb88779]::hir::ItemId], rustc_span[198bb2277a7734d7]::ErrorGuaranteed, ::par_items::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}>::{closure#0}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>> as rayon_core[d62d1a8c2a76ce74]::job::Job>::execute 40: 0x7b50d24a690e - ::wait_until_cold 41: 0x7b50d24a4499 - ::run 42: 0x7b50d298a4a7 - <::spawn<::build_scoped, rustc_driver_impl[be7972101cd0935a]::run_compiler::{closure#0}>::{closure#1}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[d79dc78584d485d1]::util::run_in_thread_pool_with_globals, rustc_driver_impl[be7972101cd0935a]::run_compiler::{closure#0}>::{closure#1}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[5eff1680495eda70]::result::Result<(), rustc_span[198bb2277a7734d7]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[5eff1680495eda70]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 43: 0x7b50d297f0ce - std[484d8c24ec532d56]::sys::backtrace::__rust_begin_short_backtrace:: + core[5eff1680495eda70]::marker::Send>, ()> 44: 0x7b50d298a14a - <::spawn_unchecked_ + core[5eff1680495eda70]::marker::Send>, ()>::{closure#1} as core[5eff1680495eda70]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 45: 0x7b50d4e947af - std::sys::pal::unix::thread::Thread::new::thread_start::h17c8afa67f401ea5 46: 0x7b50d658939d - 47: 0x7b50d660e49c - 48: 0x0 - ```

theemathas commented 1 month ago

Probably a duplicate of #129112

For now, don't use the -Z threads option.

saethlin commented 1 month ago

Closing as duplicate (I wish we could link issues to issues instead)