Skip to content

Incremental code compile caused issue with rustc_hir #92591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
palfrey opened this issue Jan 5, 2022 · 2 comments
Closed

Incremental code compile caused issue with rustc_hir #92591

palfrey opened this issue Jan 5, 2022 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@palfrey
Copy link
Contributor

palfrey commented Jan 5, 2022

This is almost certainly to do with something broken in my local target folder (which even zipped is >800mb and I can't sensibly upload that right now), as I've hit this twice now today and both times I've deleted the target folder and the problem goes away. I've hit it with just plain cargo run but I've also been running cargo fmt/clippy/doc on it as well in parallel and although they should all be blocking each other from running, maybe an issue with that setup?

Basically once I hit this cargo run consistently breaks all the time until I wipe target, and then it'll be fine for another few hours of hacking away.

Code

https://github.com/palfrey/cavalcade/tree/70d480040a5a2cdd0fb4fcf822018d584ccdac21

Meta

rustc --version --verbose:

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0

Error output

  Compiling cavalcade v0.1.0 (/home/palfrey/src/cavalcade)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: 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.57.0 (f1edd0429 2021-11-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental -C link-arg=-fuse-ld=/usr/local/bin/mold --crate-type lib

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `impl core::future::future::Future: core::marker::Send`
#1 [typeck] type-checking `server`
end of query stack
error: could not compile `cavalcade`
Backtrace

   Compiling cavalcade v0.1.0 (/home/palfrey/src/cavalcade)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
   0:     0x7f14557aba9c - std::backtrace_rs::backtrace::libunwind::trace::hf6a6dfd7da937cb0
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f14557aba9c - std::backtrace_rs::backtrace::trace_unsynchronized::hc596a19e4891f7f3
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f14557aba9c - std::sys_common::backtrace::_print_fmt::hb16700db31584325
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f14557aba9c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h231c4190cfa75162
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f1455808fdc - core::fmt::write::h2a1462b5f8eea807
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/fmt/mod.rs:1163:17
   5:     0x7f145579bc05 - std::io::Write::write_fmt::h71ddfebc68685972
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/io/mod.rs:1696:15
   6:     0x7f14557aef60 - std::sys_common::backtrace::_print::hcc197d4bebf2b369
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f14557aef60 - std::sys_common::backtrace::print::h335a66af06738c7c
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f14557aef60 - std::panicking::default_hook::{{closure}}::h6fac9ac9c8b79e52
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:210:50
   9:     0x7f14557aeb15 - std::panicking::default_hook::h341c1030c6a1161b
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:227:9
  10:     0x7f1455f9b2b1 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::h932547f60770f26a
  11:     0x7f1442470913 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hbbb28d0da550bf86
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1705:9
  12:     0x7f14424056ed - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hbce0a5e145e4c9fc
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f14557af779 - std::panicking::rust_panic_with_hook::h50680ff4b44510c6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:628:17
  14:     0x7f14557af202 - std::panicking::begin_panic_handler::{{closure}}::h9371c0fbb1e8465a
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:519:13
  15:     0x7f14557abf44 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b3efa22a5768c0f
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:139:18
  16:     0x7f14557af199 - rust_begin_unwind
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
  17:     0x7f1455773441 - core::panicking::panic_fmt::h23b9203e89cc61cf
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
  18:     0x7f145577338d - core::panicking::panic::h0ba7146865b2f9d6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:50:5
  19:     0x7f145779eb47 - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::hb925ab58899dddff
  20:     0x7f1457b0ab21 - rustc_middle::dep_graph::dep_node::<impl rustc_query_system::dep_graph::dep_node::DepNodeParams<rustc_middle::ty::context::TyCtxt> for rustc_span::def_id::LocalDefId>::recover::h2e76aa40aab4da19
  21:     0x7f145819552c - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::hc7fd02f51ac51090
  22:     0x7f1457789d6a - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  23:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  24:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  25:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  26:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  27:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  28:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  29:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  30:     0x7f1457716ecc - rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::h0eb1b79b9e091780
  31:     0x7f145773366d - rustc_query_system::query::plumbing::get_query::he848c9a74d759f95
  32:     0x7f1457785d24 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation::h2b78688237f47182
  33:     0x7f145799e9d9 - <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation::h8dd6b3a9b1045c30
  34:     0x7f145799ee00 - <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow::h9254e4a68f95d40c
  35:     0x7f14579c161d - rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation::hd2a96a9f24be244a
  36:     0x7f14579bac03 - rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations::hfe1bcc41b6d0982a
  37:     0x7f14579ed99d - rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations::h44a6a3ba4a0d74cb
  38:     0x7f14579ba059 - rustc_trait_selection::traits::fulfill::FulfillmentContext::select::hbd72a111ba645b38
  39:     0x7f14579ba9d2 - <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_with_constness_where_possible::hf54390769d3623c5
  40:     0x7f14572fc035 - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types::hb3f4f84e721f7892
  41:     0x7f14572ed666 - rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call::h1748ff855a2b13b0
  42:     0x7f14572ec69f - rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_call::h08eee6894169bf16
  43:     0x7f14573090cb - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::hfb01ad39365f71e9
  44:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  45:     0x7f14572fe80a - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt::h206b9017fe61fc2c
  46:     0x7f14572fef97 - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected::hb89ea3f54f7a6dce
  47:     0x7f145730bc22 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::hfb01ad39365f71e9
  48:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  49:     0x7f14572fefdc - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected::hb89ea3f54f7a6dce
  50:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  51:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  52:     0x7f14572fefdc - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected::hb89ea3f54f7a6dce
  53:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  54:     0x7f14572f2eb7 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr::h7449d472c419ec82
  55:     0x7f14573e1f8d - rustc_typeck::check::check::check_fn::hfd162ee8b74f5577
  56:     0x7f1457308251 - rustc_typeck::check::closure::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_closure::he9c013431cb1d995
  57:     0x7f145730b06c - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::hfb01ad39365f71e9
  58:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  59:     0x7f14572fc15a - rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types::hb3f4f84e721f7892
  60:     0x7f14572ed666 - rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call::h1748ff855a2b13b0
  61:     0x7f14572ec69f - rustc_typeck::check::callee::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_call::h08eee6894169bf16
  62:     0x7f14573090cb - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind::hfb01ad39365f71e9
  63:     0x7f14572f1e3b - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::h14ea338a26c79a01
  64:     0x7f14572f2eb7 - rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr::h7449d472c419ec82
  65:     0x7f14573e1f8d - rustc_typeck::check::check::check_fn::hfd162ee8b74f5577
  66:     0x7f1457369d04 - rustc_infer::infer::InferCtxtBuilder::enter::hfd0c29f454bb3dd3
  67:     0x7f145735fb13 - rustc_typeck::check::typeck::hd2945a0033787c16
  68:     0x7f14581be6e1 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h2483c0c71c4f2b2a
  69:     0x7f1458168b33 - rustc_data_structures::stack::ensure_sufficient_stack::h505c3226f8bf8a56
  70:     0x7f14576fe895 - rustc_query_system::query::plumbing::try_execute_query::h7c58dd7d89c4c4cf
  71:     0x7f1458082c23 - rustc_query_system::query::plumbing::force_query_impl::hb27911982f28ae98
  72:     0x7f1458197346 - rustc_query_impl::query_callbacks::typeck::force_from_dep_node::hd32e9d234745bec5
  73:     0x7f1457789d6a - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  74:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  75:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  76:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  77:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  78:     0x7f1457789d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  79:     0x7f14577172aa - rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::h10cfccd9dcdc48f2
  80:     0x7f14576f7672 - rustc_query_system::query::plumbing::try_execute_query::h5e8ca9cdff1d8669
  81:     0x7f1457781176 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_of::h91474f612f5fd18f
  82:     0x7f14573cc92d - rustc_typeck::check::check::check_item_type::h83aecb3db5647369
  83:     0x7f14573a0137 - rustc_middle::hir::map::Map::visit_item_likes_in_module::hb332e99923689268
  84:     0x7f1457ebb3ac - rustc_typeck::check::check::check_mod_item_types::h5a35f43b9b9d9dea
  85:     0x7f14581c7731 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h429476b70c6d8b4c
  86:     0x7f14581736b3 - rustc_data_structures::stack::ensure_sufficient_stack::he8ab55a8c5d4796d
  87:     0x7f14576f0fa9 - rustc_query_system::query::plumbing::try_execute_query::h3f25d612f789df1c
  88:     0x7f14581a2b65 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_item_types::h1109e01393bf5f0a
  89:     0x7f1457e976e1 - rustc_middle::hir::map::Map::for_each_module::hf1d120cb6d680f52
  90:     0x7f1457e464d0 - rustc_typeck::check_crate::h6215961d94aab927
  91:     0x7f1457ba50a0 - rustc_interface::passes::analysis::h9fda1a8ae44d53e7
  92:     0x7f14581bf3cf - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h26e86d963a73dec8
  93:     0x7f1458164609 - rustc_data_structures::stack::ensure_sufficient_stack::h135baf7277c4d193
  94:     0x7f1458088a7b - rustc_query_system::query::plumbing::try_execute_query::h0bf7639d3f58bfbd
  95:     0x7f14581a1232 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::ha2144cf05b40d10d
  96:     0x7f1457b99ca9 - rustc_interface::passes::QueryContext::enter::h0523b23606206a0b
  97:     0x7f1457b80977 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hf84cd18c24bd5171
  98:     0x7f1457b6e0ee - rustc_span::with_source_map::h6ab8a240e103b5b9
  99:     0x7f1457b802ac - scoped_tls::ScopedKey<T>::set::hd1fbd64c6f645895
 100:     0x7f1457b6eef5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0a1328c9fa7f7448
 101:     0x7f1457b9a962 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4ea1ced06d6b3e97
 102:     0x7f14557ba933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7bd677a5dc988be6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
 103:     0x7f14557ba933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7b1c1ba11c4db785
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
 104:     0x7f14557ba933 - std::sys::unix::thread::Thread::new::thread_start::h9c58c0d12d84e854
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys/unix/thread.rs:106:17
 105:     0x7f14556d9ea7 - start_thread
 106:     0x7f14555f6def - clone
 107:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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.57.0 (f1edd0429 2021-11-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental -C link-arg=-fuse-ld=/usr/local/bin/mold --crate-type lib

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `impl core::future::future::Future: core::marker::Send`
#1 [typeck] type-checking `server`
#2 [type_of] computing type of `server::{opaque#0}`
#3 [check_mod_item_types] checking item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `cavalcade`

@palfrey palfrey added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 5, 2022
@Aaron1011
Copy link
Member

This is a know issue, and is fixed in the latest nightly.

@palfrey
Copy link
Contributor Author

palfrey commented Jan 5, 2022

Instance of #90682 et al probably?

@palfrey palfrey closed this as completed Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants