Open darkseid-is opened 1 week ago
@darkseid-is do you have a complete example? I.e. the code snippet you posted is at least using something like tracing
and tracing_subscriber
alongside an async runtime. Do you have a small project we can try to reproduce the ICE with?
I am sorry the project is bit large to share. 8453 LOC . The project uses tokio
runtime. Even removing the tracing
part from the code, causes panic. Thank You.
Does the panic still repro after you do cargo clean
-> cargo check
or cargo build
again?
cleaning and rebuilding fixes the issue. Commenting and uncommenting the code also fixes the issue too.
Seems like something is messed up about your incremental cache (it could be a bug in rustc's incremental caching logic or it could be file corruption) but these issues are unfortunately hard to diagnose the root cause of without a reliable reproducer. I'll mark this as such, maybe someone can figure out how to reproduce this.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` thread 'rustc' panicked at compiler/rustc_hir/src/definitions.rs:389:13: ("Failed to extract DefId", def_kind, PackedFingerprint(Fingerprint(8995154711048952027, 5129404986291511177))) stack backtrace: 0: rust_begin_unwind at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5 1: core::panicking::panic_fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14 2:::local_def_path_hash_to_def_id::err
3: ::extract_def_id
4: ::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode)>>::call_once
5: >::try_mark_previous_green::
6: >::try_mark_previous_green::
7: >::try_mark_previous_green::
8: >::try_mark_previous_green::
9: >::try_mark_previous_green::
10: rustc_query_system::query::plumbing::try_execute_query::>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
11: ::process_obligation
12: >::process_obligations::
13: ::make_canonicalized_query_response::<()>
14: rustc_traits::type_op::type_op_prove_predicate
[... omitted 1 frame ...]
15: ::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd>
16: ::normalize_and_prove_instantiated_predicates
17: ::visit_constant
18: ::visit_body
19: rustc_borrowck::type_check::type_check
20: rustc_borrowck::nll::compute_regions
21: rustc_borrowck::do_mir_borrowck
[... omitted 5 frames ...]
22: rustc_interface::passes::analysis
[... omitted 1 frame ...]
23: rustc_interface::interface::run_compiler::, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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: rustc 1.80.1 (3f5fd8dd4 2024-08-06) running on x86_64-unknown-linux-gnu
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@zxy/src/run/runner.rs:22:1: 79:2}: core::marker::Send`
#1 [type_op_prove_predicate] evaluating `type_op_prove_predicate` `ProvePredicate { predicate: Binder { value: TraitPredicate(<{async block@zxy/src/main.rs:135:48: 141:14} as core::marker::Send>, polarity:Positive), bound_vars: [] } }`
#2 [mir_borrowck] borrow-checking `main::{closure#0}`
#3 [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_hir/src/definitions.rs:389:13:
("Failed to extract DefId", type_of, PackedFingerprint(Fingerprint(8995154711048952027, 5129404986291511177)))
stack backtrace:
0: rust_begin_unwind
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
1: core::panicking::panic_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14
2: ::local_def_path_hash_to_def_id::err
3: ::extract_def_id
4: rustc_interface::callbacks::dep_node_debug
5: ::fmt
6: core::fmt::rt::Argument::fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63
7: core::fmt::write
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21
8: std::io::Write::write_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/mod.rs:1835:15
9: <&std::io::stdio::Stderr as std::io::Write>::write_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/stdio.rs:1019:9
10: ::write_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/stdio.rs:993:9
11: std::io::stdio::print_to
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/stdio.rs:1117:21
12: std::io::stdio::_eprint
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/stdio.rs:1238:5
13: rustc_query_system::dep_graph::graph::print_markframe_trace::
14: >::try_mark_previous_green::
15: >::try_mark_previous_green::
16: >::try_mark_previous_green::
17: >::try_mark_previous_green::
18: >::try_mark_previous_green::
19: rustc_query_system::query::plumbing::try_execute_query::>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
20: ::process_obligation
21: >::process_obligations::
22: ::make_canonicalized_query_response::<()>
23: rustc_traits::type_op::type_op_prove_predicate
[... omitted 1 frame ...]
24: ::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd>
25: ::normalize_and_prove_instantiated_predicates
26: ::visit_constant
27: ::visit_body
28: rustc_borrowck::type_check::type_check
29: rustc_borrowck::nll::compute_regions
30: rustc_borrowck::do_mir_borrowck
[... omitted 5 frames ...]
31: rustc_interface::passes::analysis
[... omitted 1 frame ...]
32: rustc_interface::interface::run_compiler::, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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: rustc 1.80.1 (3f5fd8dd4 2024-08-06) running on x86_64-unknown-linux-gnu
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@zxy/src/run/runner.rs:22:1: 79:2}: core::marker::Send`
#1 [type_op_prove_predicate] evaluating `type_op_prove_predicate` `ProvePredicate { predicate: Binder { value: TraitPredicate(<{async block@zxy/src/main.rs:135:48: 141:14} as core::marker::Send>, polarity:Positive), bound_vars: [] } }`
#2 [mir_borrowck] borrow-checking `main::{closure#0}`
#3 [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 mir_borrowck(zxy[7cd5]::main)
end of try_mark_green dep node stack
```