Skip to content

Nightly internal compiler error in def_path_hash_map.rs #89361

Closed
@Nutomic

Description

@Nutomic

I'm hitting an internal compiler error in the latest nightly (cargo 1.57). The same code compiles fine on stable, and also on the previous nightly I used (not sure which version it was). Sorry I dont have time to create a minimal example, as this problem occurs in a quite large project.

To reproduce

git clone https://github.com/LemmyNet/lemmy.git
cd lemmy
cargo build

Meta

rustc --version --verbose:

cargo 1.57.0-nightly (0121d66aa 2021-09-22)
release: 1.57.0
commit-hash: 0121d66aa2ef5ffa9735f86c2b56f5fdc5a837a6
commit-date: 2021-09-22

Error output

~/workspace/lemmy ~/workspace/lemmy/api_tests
Compiling lemmy_db_schema v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/db_schema)
Compiling lemmy_utils v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/utils)
Compiling lemmy_db_queries v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/db_queries)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:85
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-nightly (8f8092cc3 2021-09-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=0 -C incremental --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 `diesel::query_builder::update_statement::UpdateStatement<lemmy_db_schema::schema::site::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::operators::Eq<lemmy_db_schema::schema::site::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, (diesel::query_builder::update_statement::changeset::Assign<lemmy_db_schema::schema::site::columns::creator_id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, diesel::query_builder::update_statement::changeset::Assign<lemmy_db_schema::schema::site::columns::updated, diesel::expression::bound::Bound<diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, chrono::naive::datetime::NaiveDateTime>>)>: diesel::query_builder::AsQuery`
#1 [typeck] type-checking `source::site::<impl at crates/db_queries/src/source/site.rs:35:1: 47:2>::transfer`
end of query stack
error: could not compile `lemmy_db_queries`
Backtrace

0: rust_begin_unwind
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/core/src/panicking.rs:100:14
2: core::panicking::panic
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/core/src/panicking.rs:50:5
3: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash_to_def_id
4: <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id
5: 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::DefId>::recover
6: rustc_query_system::query::plumbing::force_query
7: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
8: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
9: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
10: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
11: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
12: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
13: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
14: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
15: rustc_data_structures::stack::ensure_sufficient_stack
16: rustc_query_system::query::plumbing::get_query
17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation
18: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
19: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
20: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_with_constness_where_possible
21: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
22: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_method_argument_types
23: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
24: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
25: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
26: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
27: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
28: rustc_typeck::check::check::check_fn
29: rustc_infer::infer::InferCtxtBuilder::enter
30: rustc_typeck::check::typeck
31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
32: rustc_data_structures::stack::ensure_sufficient_stack
33: rustc_query_system::query::plumbing::try_execute_query
34: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
35: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
36: rustc_typeck::check::typeck_item_bodies
37: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
38: rustc_data_structures::stack::ensure_sufficient_stack
39: rustc_query_system::query::plumbing::try_execute_query
40: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
41: rustc_session::utils::<impl rustc_session::session::Session>::time
42: rustc_typeck::check_crate
43: rustc_interface::passes::analysis
44: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
45: rustc_data_structures::stack::ensure_sufficient_stack
46: rustc_query_system::query::plumbing::try_execute_query
47: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
48: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
49: rustc_span::with_source_map
50: rustc_interface::interface::create_compiler_and_run

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions