Closed
Description
Code
I just added a few lines to a project that was compiling, The project is quite large and not something that I can share publicly, However, I will try to get small test case.
Meta
rustc --version --verbose
:
rustc 1.62.0-nightly (69a5d2481 2022-04-27)
binary: rustc
commit-hash: 69a5d2481e856a5a18885390b8cf6950b9ff8dd3
commit-date: 2022-04-27
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.1
Error output
thread 'rustc' panicked at 'DefId::expect_local: `DefId(21:256 ~ midi_io[b6c0]::parser::midi_codec)` isn't local', /rustc/69a5d2481e856a5a18885390b8cf6950b9ff8dd3/compiler/rustc_span/src/def_id.rs:283:43
Backtrace
stack backtrace:
0: rust_begin_unwind
at /rustc/69a5d2481e856a5a18885390b8cf6950b9ff8dd3/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/69a5d2481e856a5a18885390b8cf6950b9ff8dd3/library/core/src/panicking.rs:142:14
2: <rustc_typeck::check::fn_ctxt::FnCtxt>::report_method_error
3: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
4: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
5: <rustc_typeck::check::fn_ctxt::FnCtxt>::demand_scrutinee_type
6: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_match
7: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
8: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
9: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
10: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
11: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
12: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
13: rustc_typeck::check::check::check_fn
14: <rustc_infer::infer::InferCtxtBuilder>::enter::<&rustc_middle::ty::context::TypeckResults, <rustc_typeck::check::inherited::InheritedBuilder>::enter<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
15: rustc_typeck::check::typeck
16: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
18: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
19: rustc_query_impl::query_callbacks::typeck::force_from_dep_node
20: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
21: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
22: rustc_query_system::query::plumbing::ensure_must_run::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, ()>
23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
24: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>
25: rustc_typeck::check::typeck_item_bodies
26: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), ()>
27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
28: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
29: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#7}>
30: rustc_typeck::check_crate
31: rustc_interface::passes::analysis
32: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
33: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
34: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
35: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
36: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
37: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
38: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
39: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.62.0-nightly (69a5d2481 2022-04-27) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -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 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
warning: `jack_midi` (bin "jack_midi") generated 1 warning
error: could not compile `jack_midi`; 1 warning emitted