Skip to content
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

Compile crash after performing module rename via rust analyzer, but only when compiling for test with nightly, workaround by running cargo clean #90608

Closed
barafael opened this issue Nov 5, 2021 · 5 comments
Labels
A-incr-comp Area: Incremental compilation 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

@barafael
Copy link

barafael commented Nov 5, 2021

This compile crash occurred after doing some refactorings with rust analyzer (via VSCode). The last refactoring I did before was renaming a module by renaming a directory in VSCode. The crash does not occur with cargo build or cargo +stable test. But I also did not run these commands for a while before that, so they were probably doing a clean build.

After running cargo clean, everything is fine again. Sorry for not having code I can share.

Meta

rustc --version --verbose:

rustc 1.58.0-nightly (ff0e14829 2021-10-31)
binary: rustc
commit-hash: ff0e14829e1806ca0d4226595f7fdf3e8658758f
commit-date: 2021-10-31
host: x86_64-unknown-linux-gnu
release: 1.58.0-nightly
LLVM version: 13.0.0

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/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.58.0-nightly (ff0e14829 2021-10-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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 `mod_a::mod_b::<impl at src/mod_a/thing.rs:37:1: 96:2>::start`
end of query stack
error: could not compile `thing`
Backtrace

> RUST_BACKTRACE=full cargo test
   Compiling thing v0.0.1 (/home/user/project)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
   0:     0x7f8b4b0047bc - std::backtrace_rs::backtrace::libunwind::trace::hc6c3491277866fea
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8b4b0047bc - std::backtrace_rs::backtrace::trace_unsynchronized::h4524f073368a5b13
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8b4b0047bc - std::sys_common::backtrace::_print_fmt::h0d0cace6159902af
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f8b4b0047bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3e6af6f05919a7fc
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f8b4b0619fc - core::fmt::write::h72801a82c94e6ff1
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/core/src/fmt/mod.rs:1149:17
   5:     0x7f8b4aff4e95 - std::io::Write::write_fmt::ha4f5d34aaccbac84
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/io/mod.rs:1697:15
   6:     0x7f8b4b007a10 - std::sys_common::backtrace::_print::heed69f5ce9a8e189
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f8b4b007a10 - std::sys_common::backtrace::print::h5f3918bd80c09252
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f8b4b007a10 - std::panicking::default_hook::{{closure}}::h5af30648530eb3d0
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/panicking.rs:211:50
   9:     0x7f8b4b0075bb - std::panicking::default_hook::he88d5fb1ba1b4c19
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/panicking.rs:228:9
  10:     0x7f8b4b79baa1 - rustc_driver[3d33b2d383bdce56]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f8b2de54263 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4812d27d2f51a9ce
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/alloc/src/boxed.rs:1705:9
  12:     0x7f8b2de5d18d - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h96debdda741189d0
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f8b4b008229 - std::panicking::rust_panic_with_hook::h01febc308b2b313b
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/panicking.rs:610:17
  14:     0x7f8b4b007cb2 - std::panicking::begin_panic_handler::{{closure}}::h24a6d13f5560b71f
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/panicking.rs:500:13
  15:     0x7f8b4b004c64 - std::sys_common::backtrace::__rust_end_short_backtrace::h3e2917f0da9fbc5c
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys_common/backtrace.rs:139:18
  16:     0x7f8b4b007c49 - rust_begin_unwind
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/panicking.rs:498:5
  17:     0x7f8b4afcd151 - core::panicking::panic_fmt::h7b8580d81fcbbacd
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/core/src/panicking.rs:106:14
  18:     0x7f8b4afcd09d - core::panicking::panic::h50b51d19800453c0
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/core/src/panicking.rs:47:5
  19:     0x7f8b4d55c540 - <rustc_query_system[7f051701b6960462]::dep_graph::dep_node::DepNode<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind> as rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepNodeExt>::extract_def_id
  20:     0x7f8b4db6b6ae - rustc_query_impl[41b547aa76321427]::query_callbacks::hir_owner::force_from_dep_node
  21:     0x7f8b4de87e21 - <rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt as rustc_query_system[7f051701b6960462]::dep_graph::DepContext>::try_force_from_dep_node
  22:     0x7f8b4d0e874c - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  23:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  24:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  25:     0x7f8b4d0c2e10 - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<core[cc79c391059f8e46]::option::Option<(core[cc79c391059f8e46]::result::Result<rustc_middle[b2c77fbe63027f7a]::traits::select::EvaluationResult, rustc_middle[b2c77fbe63027f7a]::traits::select::OverflowError>, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex)>, rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_middle[b2c77fbe63027f7a]::infer::canonical::Canonical<rustc_middle[b2c77fbe63027f7a]::ty::ParamEnvAnd<rustc_middle[b2c77fbe63027f7a]::ty::Predicate>>, core[cc79c391059f8e46]::result::Result<rustc_middle[b2c77fbe63027f7a]::traits::select::EvaluationResult, rustc_middle[b2c77fbe63027f7a]::traits::select::OverflowError>>::{closure#2}>
  26:     0x7f8b4d07a63f - rustc_query_system[7f051701b6960462]::query::plumbing::get_query::<rustc_query_impl[41b547aa76321427]::queries::evaluate_obligation, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  27:     0x7f8b4d0e5924 - <rustc_query_impl[41b547aa76321427]::Queries as rustc_middle[b2c77fbe63027f7a]::ty::query::QueryEngine>::evaluate_obligation
  28:     0x7f8b4d38e77f - <rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillProcessor>::progress_changed_obligations
  29:     0x7f8b4d3c55d2 - <rustc_data_structures[3cd648c062680881]::obligation_forest::ObligationForest<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillProcessor, rustc_data_structures[3cd648c062680881]::obligation_forest::Outcome<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::PendingPredicateObligation, rustc_infer[92dc9ce8420627c]::traits::FulfillmentErrorCode>>
  30:     0x7f8b4d38cb7d - <rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillmentContext as rustc_infer[92dc9ce8420627c]::traits::engine::TraitEngine>::select_with_constness_where_possible
  31:     0x7f8b4cba88f1 - <rustc_infer[92dc9ce8420627c]::infer::InferCtxtBuilder>::enter::<&rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults, <rustc_typeck[33590460456ed24b]::check::inherited::InheritedBuilder>::enter<rustc_typeck[33590460456ed24b]::check::typeck_with_fallback<rustc_typeck[33590460456ed24b]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>::{closure#0}>
  32:     0x7f8b4cb7ca1d - rustc_typeck[33590460456ed24b]::check::typeck
  33:     0x7f8b4db91f33 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>
  34:     0x7f8b4db5b14e - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<(&rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex), rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>::{closure#3}>
  35:     0x7f8b4d0482ab - rustc_query_system[7f051701b6960462]::query::plumbing::try_execute_query::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_query_system[7f051701b6960462]::query::caches::DefaultCache<rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>>
  36:     0x7f8b4da77ab8 - rustc_query_system[7f051701b6960462]::query::plumbing::force_query::<rustc_query_impl[41b547aa76321427]::queries::typeck, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  37:     0x7f8b4db6d371 - rustc_query_impl[41b547aa76321427]::query_callbacks::typeck::force_from_dep_node
  38:     0x7f8b4de87e21 - <rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt as rustc_query_system[7f051701b6960462]::dep_graph::DepContext>::try_force_from_dep_node
  39:     0x7f8b4d0e874c - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  40:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  41:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  42:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  43:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  44:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  45:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  46:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  47:     0x7f8b4d0c2e10 - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<core[cc79c391059f8e46]::option::Option<(core[cc79c391059f8e46]::result::Result<rustc_middle[b2c77fbe63027f7a]::traits::select::EvaluationResult, rustc_middle[b2c77fbe63027f7a]::traits::select::OverflowError>, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex)>, rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_middle[b2c77fbe63027f7a]::infer::canonical::Canonical<rustc_middle[b2c77fbe63027f7a]::ty::ParamEnvAnd<rustc_middle[b2c77fbe63027f7a]::ty::Predicate>>, core[cc79c391059f8e46]::result::Result<rustc_middle[b2c77fbe63027f7a]::traits::select::EvaluationResult, rustc_middle[b2c77fbe63027f7a]::traits::select::OverflowError>>::{closure#2}>
  48:     0x7f8b4d07a63f - rustc_query_system[7f051701b6960462]::query::plumbing::get_query::<rustc_query_impl[41b547aa76321427]::queries::evaluate_obligation, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  49:     0x7f8b4d0e5924 - <rustc_query_impl[41b547aa76321427]::Queries as rustc_middle[b2c77fbe63027f7a]::ty::query::QueryEngine>::evaluate_obligation
  50:     0x7f8b4d38e77f - <rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillProcessor>::progress_changed_obligations
  51:     0x7f8b4d3c55d2 - <rustc_data_structures[3cd648c062680881]::obligation_forest::ObligationForest<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillProcessor, rustc_data_structures[3cd648c062680881]::obligation_forest::Outcome<rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::PendingPredicateObligation, rustc_infer[92dc9ce8420627c]::traits::FulfillmentErrorCode>>
  52:     0x7f8b4d38cb7d - <rustc_trait_selection[94d1ab35a48e091a]::traits::fulfill::FulfillmentContext as rustc_infer[92dc9ce8420627c]::traits::engine::TraitEngine>::select_with_constness_where_possible
  53:     0x7f8b4cb3c7c4 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_argument_types
  54:     0x7f8b4cb236af - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  55:     0x7f8b4cb20ac8 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_call
  56:     0x7f8b4cb4ffe9 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  57:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  58:     0x7f8b4cb3c90c - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_argument_types
  59:     0x7f8b4cb236af - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  60:     0x7f8b4cb20ac8 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_call
  61:     0x7f8b4cb4ffe9 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  62:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  63:     0x7f8b4cb52586 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  64:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  65:     0x7f8b4cb3feb2 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_decl_local
  66:     0x7f8b4cb40899 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_stmt
  67:     0x7f8b4cb414c1 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  68:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  69:     0x7f8b4cb5006f - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  70:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  71:     0x7f8b4cb5006f - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  72:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  73:     0x7f8b4cb411ab - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  74:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  75:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  76:     0x7f8b4cb411ab - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  77:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  78:     0x7f8b4cb2db17 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_return_expr
  79:     0x7f8b4cc32df4 - rustc_typeck[33590460456ed24b]::check::check::check_fn
  80:     0x7f8b4cb4f20e - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_closure
  81:     0x7f8b4cb52d51 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  82:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  83:     0x7f8b4cb3c90c - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_argument_types
  84:     0x7f8b4cb236af - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  85:     0x7f8b4cb20ac8 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_call
  86:     0x7f8b4cb4ffe9 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_kind
  87:     0x7f8b4cb2af00 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  88:     0x7f8b4cb2db17 - <rustc_typeck[33590460456ed24b]::check::fn_ctxt::FnCtxt>::check_return_expr
  89:     0x7f8b4cc32df4 - rustc_typeck[33590460456ed24b]::check::check::check_fn
  90:     0x7f8b4cba6a26 - <rustc_infer[92dc9ce8420627c]::infer::InferCtxtBuilder>::enter::<&rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults, <rustc_typeck[33590460456ed24b]::check::inherited::InheritedBuilder>::enter<rustc_typeck[33590460456ed24b]::check::typeck_with_fallback<rustc_typeck[33590460456ed24b]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>::{closure#0}>
  91:     0x7f8b4cb7ca1d - rustc_typeck[33590460456ed24b]::check::typeck
  92:     0x7f8b4db91f33 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>
  93:     0x7f8b4db5b14e - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<(&rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex), rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>::{closure#3}>
  94:     0x7f8b4d0482ab - rustc_query_system[7f051701b6960462]::query::plumbing::try_execute_query::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_query_system[7f051701b6960462]::query::caches::DefaultCache<rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, &rustc_middle[b2c77fbe63027f7a]::ty::context::TypeckResults>>
  95:     0x7f8b4da77ab8 - rustc_query_system[7f051701b6960462]::query::plumbing::force_query::<rustc_query_impl[41b547aa76321427]::queries::typeck, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  96:     0x7f8b4db6d371 - rustc_query_impl[41b547aa76321427]::query_callbacks::typeck::force_from_dep_node
  97:     0x7f8b4de87e21 - <rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt as rustc_query_system[7f051701b6960462]::dep_graph::DepContext>::try_force_from_dep_node
  98:     0x7f8b4d0e874c - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
  99:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 100:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 101:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 102:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 103:     0x7f8b4d0e7bb5 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 104:     0x7f8b4d0c4d8a - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<core[cc79c391059f8e46]::option::Option<(&rustc_middle[b2c77fbe63027f7a]::ty::TyS, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex)>, rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_span[b6a32fa5db97fd22]::def_id::DefId, &rustc_middle[b2c77fbe63027f7a]::ty::TyS>::{closure#2}>
 105:     0x7f8b4d0d2768 - <rustc_query_impl[41b547aa76321427]::Queries as rustc_middle[b2c77fbe63027f7a]::ty::query::QueryEngine>::type_of
 106:     0x7f8b4cc216dc - rustc_typeck[33590460456ed24b]::check::check::check_item_type
 107:     0x7f8b4cba433e - <rustc_middle[b2c77fbe63027f7a]::hir::map::Map>::visit_item_likes_in_module::<rustc_typeck[33590460456ed24b]::check::CheckItemTypesVisitor>
 108:     0x7f8b4d8d8a3c - rustc_typeck[33590460456ed24b]::check::check::check_mod_item_types
 109:     0x7f8b4db93ab2 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, ()>
 110:     0x7f8b4db5d67e - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<((), rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex), rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, ()>::{closure#3}>
 111:     0x7f8b4d04aede - rustc_query_system[7f051701b6960462]::query::plumbing::try_execute_query::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_query_system[7f051701b6960462]::query::caches::DefaultCache<rustc_span[b6a32fa5db97fd22]::def_id::LocalDefId, ()>>
 112:     0x7f8b4db0f403 - rustc_query_system[7f051701b6960462]::query::plumbing::get_query::<rustc_query_impl[41b547aa76321427]::queries::check_mod_item_types, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 113:     0x7f8b4d88bdd2 - <rustc_middle[b2c77fbe63027f7a]::hir::map::Map>::for_each_module::<rustc_typeck[33590460456ed24b]::check_crate::{closure#6}::{closure#0}>
 114:     0x7f8b4d87d930 - <rustc_session[9024c0122e896071]::session::Session>::time::<(), rustc_typeck[33590460456ed24b]::check_crate::{closure#6}>
 115:     0x7f8b4d873173 - rustc_typeck[33590460456ed24b]::check_crate
 116:     0x7f8b4d6270d7 - rustc_interface[fdf6df4a042dd987]::passes::analysis
 117:     0x7f8b4dbaf2b0 - <rustc_query_system[7f051701b6960462]::dep_graph::graph::DepGraph<rustc_middle[b2c77fbe63027f7a]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b2c77fbe63027f7a]::ty::context::TyCtxt, (), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
 118:     0x7f8b4db565c3 - rustc_data_structures[3cd648c062680881]::stack::ensure_sufficient_stack::<(core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_query_system[7f051701b6960462]::dep_graph::graph::DepNodeIndex), rustc_query_system[7f051701b6960462]::query::plumbing::execute_job<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, (), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#3}>
 119:     0x7f8b4dabac76 - rustc_query_system[7f051701b6960462]::query::plumbing::try_execute_query::<rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt, rustc_query_system[7f051701b6960462]::query::caches::DefaultCache<(), core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>>
 120:     0x7f8b4db1d0e5 - rustc_query_system[7f051701b6960462]::query::plumbing::get_query::<rustc_query_impl[41b547aa76321427]::queries::analysis, rustc_query_impl[41b547aa76321427]::plumbing::QueryCtxt>
 121:     0x7f8b4d6177d9 - <rustc_interface[fdf6df4a042dd987]::passes::QueryContext>::enter::<rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
 122:     0x7f8b4d605ba4 - <rustc_interface[fdf6df4a042dd987]::interface::Compiler>::enter::<rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}::{closure#2}, core[cc79c391059f8e46]::result::Result<core[cc79c391059f8e46]::option::Option<rustc_interface[fdf6df4a042dd987]::queries::Linker>, rustc_errors[932abaefb61eb634]::ErrorReported>>
 123:     0x7f8b4d5f5f7f - rustc_span[b6a32fa5db97fd22]::with_source_map::<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_interface[fdf6df4a042dd987]::interface::create_compiler_and_run<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}>::{closure#0}>
 124:     0x7f8b4d606ad0 - <scoped_tls[3fea4c3dcac147b1]::ScopedKey<rustc_span[b6a32fa5db97fd22]::SessionGlobals>>::set::<rustc_interface[fdf6df4a042dd987]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[fdf6df4a042dd987]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
 125:     0x7f8b4d5f8a25 - std[fcea40badc263c8f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fdf6df4a042dd987]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[fdf6df4a042dd987]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>
 126:     0x7f8b4d5f4b42 - <<std[fcea40badc263c8f]::thread::Builder>::spawn_unchecked<rustc_interface[fdf6df4a042dd987]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[fdf6df4a042dd987]::interface::run_compiler<core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>, rustc_driver[3d33b2d383bdce56]::run_compiler::{closure#1}>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#0}, core[cc79c391059f8e46]::result::Result<(), rustc_errors[932abaefb61eb634]::ErrorReported>>::{closure#1} as core[cc79c391059f8e46]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 127:     0x7f8b4b013513 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd81bd86213781012
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/alloc/src/boxed.rs:1691:9
 128:     0x7f8b4b013513 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7b3e346f5d8f6d6a
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/alloc/src/boxed.rs:1691:9
 129:     0x7f8b4b013513 - std::sys::unix::thread::Thread::new::thread_start::ha575792f17151d60
                               at /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f/library/std/src/sys/unix/thread.rs:106:17
 130:     0x7f8b4af50609 - start_thread
                               at /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477:8
 131:     0x7f8b4ae64293 - clone
 132:                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.58.0-nightly (ff0e14829 2021-10-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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 `diagnostic::server::<impl at src/diagnostic/server.rs:37:1: 96:2>::start`
#2 [evaluate_obligation] evaluating trait selection obligation `impl core::future::future::Future: core::marker::Send`
#3 [typeck] type-checking `run`
#4 [type_of] computing type of `run::{opaque#0}`
#5 [check_mod_item_types] checking item types in top-level module
#6 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `thing`
</p>
</details>

@barafael barafael 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 Nov 5, 2021
@yanchith
Copy link
Contributor

yanchith commented Nov 10, 2021

Same happens to me after renaming a type manually. rustc 1.58.0-nightly (ff0e14829 2021-10-31) running on x86_64-pc-windows-msvc

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/ff0e14829e1806ca0d4226595f7fdf3e8658758f\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.58.0-nightly (ff0e14829 2021-10-31) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `ph`

Unfortunately I can't release the source that triggers this, but let me know if there's something I can do to help.

UPDATE: For the same source, this seems to not happen anymore on rustc 1.58.0-nightly (495322d77 2021-11-08). It used to happen pretty regularly, forcing me to find type names that don't crash the compiler. Will post here again, if I can reproduce on 495322d77 2021-11-08

@BGR360
Copy link
Contributor

BGR360 commented Dec 21, 2021

Looks like a known incremental compilation bug. That's probably why it's so hit-or-miss.

See #91696. Hopefully fixed by #91919.

@rustbot label +A-incr-comp

@rustbot rustbot added the A-incr-comp Area: Incremental compilation label Dec 21, 2021
@marioortizmanero
Copy link

marioortizmanero commented Jan 27, 2022

This just happened to me with 1.58.0 (7f08ace4f 2021-11-24), and I wasn't renaming anything. Just refactoring some code and then ran into the error. Unfortunately, it's quite hard to track down, and after a cargo clean it was indeed fixed:

image

(sorry for screenshot instead of copy-paste, I forgot to gather information about the bug before cleaning)

@Aaron1011
Copy link
Member

@marioortizmanero: This should be fixed in the latest nightly by #93064

@workingjubilee
Copy link
Member

Closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation 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

7 participants