Skip to content

ICE: Failed to extract DefId: def_kind e8...bc #119132

Open
@0xTiger

Description

@0xTiger

Apologies, this is not minimal at all so I'm not sure how helpful it is.
It also requires compiling, switching git branches and compiling again to reproduce so I assume this ICE depends on the state of ./target somehow.
Just cloning and checking out compiler-error branch is not enough to reproduce.

Steps to reproduce

git clone https://github.com/0xTiger/rust-ice.git
cd rust-ice
rustup override set nightly
cargo check
echo "On branch master:" && git checkout master --quiet && cargo check |& grep ICE
echo "On branch compiler-error:" && git checkout compiler-error --quiet && cargo check |& grep ICE

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (3f28fe133 2023-12-18)
binary: rustc
commit-hash: 3f28fe133475ec5faf3413b556bf3cfb0d51336c
commit-date: 2023-12-18
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.6

(Can also be reproduced on stable 1.74.1)

Error output

thread 'rustc' panicked at compiler/rustc_middle/src/dep_graph/dep_node.rs:198:17:
Failed to extract DefId: def_kind e8779cef7acc8e32-bb5aef949a4dc9bc
Backtrace

thread 'rustc' panicked at compiler/rustc_middle/src/dep_graph/dep_node.rs:198:17:
Failed to extract DefId: def_kind e8779cef7acc8e32-bb5aef949a4dc9bc
stack backtrace:
   0: rust_begin_unwind
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/core/src/panicking.rs:72:14
   2: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id::{closure#0}
   3: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
   4: rustc_query_impl::plumbing::force_from_dep_node::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>>
   5: <rustc_query_impl::plumbing::query_callback<rustc_query_impl::query_impl::def_kind::QueryType>::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode)>>::call_once
   6: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   7: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   8: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   9: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  10: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  11: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  13: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  14: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  15: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  18: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  19: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_method_argument_types
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33: rustc_hir_typeck::check::check_fn
  34: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39: rustc_hir_typeck::check::check_fn
  40: rustc_hir_typeck::typeck
      [... omitted 1 frame ...]
  41: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#7}>::{closure#0}
  42: rustc_hir_analysis::check_crate
  43: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  44: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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: please attach the file at `/home/tomh/prg/rust-ice/rustc-ice-2023-12-19T18_29_26-87815.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@axum_login::session::AuthSession<auth::Backend>::authenticate::{closure#0}}: core::marker::Send`
#1 [typeck] type-checking `main`
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 type_of(thread 'rustc' panicked at compiler/rustc_middle/src/dep_graph/dep_node.rs:198:17:
Failed to extract DefId: type_of e8779cef7acc8e32-bb5aef949a4dc9bc
stack backtrace:
   0: rust_begin_unwind
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/core/src/panicking.rs:72:14
   2: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id::{closure#0}
   3: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
   4: rustc_interface::callbacks::dep_node_debug
   5: <rustc_query_system::dep_graph::dep_node::DepNode as core::fmt::Debug>::fmt
   6: core::fmt::rt::Argument::fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/core/src/fmt/rt.rs:142:9
   7: core::fmt::write
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/core/src/fmt/mod.rs:1120:17
   8: std::io::Write::write_fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/io/mod.rs:1810:15
   9: <&std::io::stdio::Stderr as std::io::Write>::write_fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/io/stdio.rs:947:9
  10: <std::io::stdio::Stderr as std::io::Write>::write_fmt
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/io/stdio.rs:921:9
  11: std::io::stdio::print_to
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/io/stdio.rs:1020:21
  12: std::io::stdio::_eprint
             at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/io/stdio.rs:1108:5
  13: rustc_query_system::dep_graph::graph::print_markframe_trace::<rustc_middle::dep_graph::DepsType>
  14: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  15: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  17: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  18: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  19: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  20: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  21: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  22: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  23: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  24: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  26: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  27: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_method_argument_types
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  39: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  40: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41: rustc_hir_typeck::check::check_fn
  42: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  43: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  45: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  46: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  47: rustc_hir_typeck::check::check_fn
  48: rustc_hir_typeck::typeck
      [... omitted 1 frame ...]
  49: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#7}>::{closure#0}
  50: rustc_hir_analysis::check_crate
  51: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  52: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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: please attach the file at `/home/tomh/prg/rust-ice/rustc-ice-2023-12-19T18_29_26-87815.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@axum_login::session::AuthSession<auth::Backend>::authenticate::{closure#0}}: core::marker::Send`
#1 [typeck] type-checking `main`
#2 [analysis] running analysis passes on this crate
end of query stack

rustc-ice-2023-12-19T18_29_26-87815.txt

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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