Closed
Description
Code
main.rs
use parking_lot::Mutex;
struct A(Mutex<A>);
fn main() {}
Cargo.toml
[package]
name = "a"
version = "1.0.0"
edition = "2021"
[dependencies]
parking_lot = "0.12.1"
Here's a working (technically not working) version on Rust Explorer.
Meta
rustc --version --verbose
:
rustc 1.67.1 (d5a82bbd2 2023-02-07)
binary: rustc
commit-hash: d5a82bbd26e1ad8b7401f6a718a9c57c96905483
commit-date: 2023-02-07
host: x86_64-unknown-linux-gnu
release: 1.67.1
LLVM version: 15.0.6
Error output
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error[E0391]: cycle detected when checking if `A` is representable
--> src/main.rs:3:1
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
|
note: ...which requires checking if `A::0` is representable...
--> src/main.rs:3:10
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
= note: ...which requires checking if `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, A>` is representable...
= note: ...which requires checking if `A` is representable...
= note: ...which again requires checking if `A` is representable, completing the cycle
note: cycle used when checking that `A` is well-formed
--> src/main.rs:3:1
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
Backtrace
thread 'rustc' panicked at 'DefId(20:96 ~ parking_lot[9ab4]::mutex::Mutex) does not have a "params_in_repr"', compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:188:1
stack backtrace:
0: rust_begin_unwind
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
2: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::params_in_repr::{closure#1}
3: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::params_in_repr
4: <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::DefId, rustc_index::bit_set::BitSet<u32>>
5: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::ArenaCache<rustc_span::def_id::DefId, rustc_index::bit_set::BitSet<u32>>>
6: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::params_in_repr, rustc_query_impl::plumbing::QueryCtxt>
7: rustc_middle::values::find_item_ty_spans
8: rustc_middle::values::recursive_type_error
9: <rustc_middle::ty::adt::Representability as rustc_query_system::values::Value<rustc_middle::ty::context::TyCtxt>>::from_cycle_error
10: rustc_query_system::query::plumbing::mk_cycle::<rustc_query_impl::plumbing::QueryCtxt, rustc_middle::ty::adt::Representability, rustc_middle::ty::adt::Representability>
11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::ty::adt::Representability>>
12: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::representability, rustc_query_impl::plumbing::QueryCtxt>
13: rustc_ty_utils::representability::representability_adt_ty
14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_middle::ty::Ty, rustc_middle::ty::adt::Representability>::{closure#3}::{closure#0}, rustc_middle::ty::adt::Representability>
15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::Ty, rustc_middle::ty::adt::Representability>>
16: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::representability_adt_ty, rustc_query_impl::plumbing::QueryCtxt>
17: rustc_ty_utils::representability::representability_ty
18: rustc_ty_utils::representability::representability_adt_ty
19: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_middle::ty::Ty, rustc_middle::ty::adt::Representability>::{closure#3}::{closure#0}, rustc_middle::ty::adt::Representability>
20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::Ty, rustc_middle::ty::adt::Representability>>
21: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::representability_adt_ty, rustc_query_impl::plumbing::QueryCtxt>
22: rustc_ty_utils::representability::representability_ty
23: rustc_ty_utils::representability::representability
24: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, rustc_middle::ty::adt::Representability>::{closure#3}::{closure#0}, rustc_middle::ty::adt::Representability>
25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::ty::adt::Representability>>
26: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::representability, rustc_query_impl::plumbing::QueryCtxt>
27: rustc_ty_utils::representability::representability
28: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_anon_task::<rustc_middle::ty::context::TyCtxt, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, rustc_middle::ty::adt::Representability>::{closure#3}::{closure#0}, rustc_middle::ty::adt::Representability>
29: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::ty::adt::Representability>>
30: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::representability, rustc_query_impl::plumbing::QueryCtxt>
31: rustc_hir_analysis::check::wfcheck::check_type_defn
32: rustc_hir_analysis::check::wfcheck::check_well_formed
33: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_hir::hir_id::OwnerId, ()>
34: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::check_well_formed, rustc_query_impl::plumbing::QueryCtxt>
35: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir::ImplItemId], <rustc_middle::hir::ModuleItems>::par_impl_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#1}>::{closure#0}>
36: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
37: <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, ()>
38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, ()>>
39: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::check_mod_type_wf, rustc_query_impl::plumbing::QueryCtxt>
40: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
41: <rustc_session::session::Session>::track_errors::<rustc_hir_analysis::check_crate::{closure#5}, ()>
42: rustc_hir_analysis::check_crate
43: rustc_interface::passes::analysis
44: <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>>
45: 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>>>
46: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
47: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
48: <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>>
49: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
50: <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.67.1 (d5a82bbd2 2023-02-07) 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 [params_in_repr] finding type parameters in the representation
#1 [representability_adt_ty] checking if `A` is representable
#2 [representability_adt_ty] checking if `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, A>` is representable
#3 [representability] checking if `A::0` is representable
#4 [representability] checking if `A` is representable
#5 [check_well_formed] checking that `A` is well-formed
#6 [check_mod_type_wf] checking that types are well-formed in top-level module
#7 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error[E0391]: cycle detected when checking if `A` is representable
--> src/main.rs:3:1
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
|
note: ...which requires checking if `A::0` is representable...
--> src/main.rs:3:10
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
= note: ...which requires checking if `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, A>` is representable...
= note: ...which requires checking if `A` is representable...
= note: ...which again requires checking if `A` is representable, completing the cycle
note: cycle used when checking that `A` is well-formed
--> src/main.rs:3:1
|
3 | struct A(Mutex<A>);
| ^^^^^^^^
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
0: 0x7f7b0d9656fa - std::backtrace_rs::backtrace::libunwind::trace::h79937bc171ada62c
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7f7b0d9656fa - std::backtrace_rs::backtrace::trace_unsynchronized::h2292bca8571cb919
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f7b0d9656fa - std::sys_common::backtrace::_print_fmt::h9c461f248e4ae90d
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:65:5
3: 0x7f7b0d9656fa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he9fe6bf1a39182e1
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f7b0d9c825e - core::fmt::write::h032658c119c720d7
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/fmt/mod.rs:1208:17
5: 0x7f7b0d955a85 - std::io::Write::write_fmt::h299fc90dfae41c0d
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/io/mod.rs:1682:15
6: 0x7f7b0d9654c5 - std::sys_common::backtrace::_print::heb70d25df9937e3f
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:47:5
7: 0x7f7b0d9654c5 - std::sys_common::backtrace::print::had745c0a76b8b521
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:34:9
8: 0x7f7b0d96820f - std::panicking::default_hook::{{closure}}::h1ea782cdfa2fd097
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:267:22
9: 0x7f7b0d967f4b - std::panicking::default_hook::h1cc3af63455a163c
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:286:9
10: 0x7f7b10c60ab1 - <rustc_driver[5c3b90d1fb3964ba]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[e6a29f2585b3d454]::ops::function::FnOnce<(&core[e6a29f2585b3d454]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
11: 0x7f7b0d968a4d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6e4950ba7c0fd82a
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/alloc/src/boxed.rs:2032:9
12: 0x7f7b0d968a4d - std::panicking::rust_panic_with_hook::h5cafdc4b3bfd5528
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:692:13
13: 0x7f7b10c997c1 - std[359ab902947f5f0b]::panicking::begin_panic::<rustc_errors[d24ea2395205e4f0]::ExplicitBug>::{closure#0}
14: 0x7f7b10c98096 - std[359ab902947f5f0b]::sys_common::backtrace::__rust_end_short_backtrace::<std[359ab902947f5f0b]::panicking::begin_panic<rustc_errors[d24ea2395205e4f0]::ExplicitBug>::{closure#0}, !>
15: 0x7f7b10c75e66 - std[359ab902947f5f0b]::panicking::begin_panic::<rustc_errors[d24ea2395205e4f0]::ExplicitBug>
16: 0x7f7b10c95566 - std[359ab902947f5f0b]::panic::panic_any::<rustc_errors[d24ea2395205e4f0]::ExplicitBug>
17: 0x7f7b10145cf6 - <rustc_errors[d24ea2395205e4f0]::HandlerInner>::flush_delayed::<alloc[89959c1738bdde42]::vec::Vec<rustc_errors[d24ea2395205e4f0]::diagnostic::Diagnostic>, &str>
18: 0x7f7b10144ffb - <rustc_errors[d24ea2395205e4f0]::HandlerInner as core[e6a29f2585b3d454]::ops::drop::Drop>::drop
19: 0x7f7b0fe2d57e - core[e6a29f2585b3d454]::ptr::drop_in_place::<rustc_session[b89b9f24749004e7]::parse::ParseSess>
20: 0x7f7b0fe1cb3f - core[e6a29f2585b3d454]::ptr::drop_in_place::<rustc_session[b89b9f24749004e7]::session::Session>
21: 0x7f7b0fe1c870 - core[e6a29f2585b3d454]::ptr::drop_in_place::<rustc_interface[65dcc5dffb099e04]::interface::Compiler>
22: 0x7f7b0fe1bc48 - rustc_span[41a321a6411ba4fa]::with_source_map::<core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>, rustc_interface[65dcc5dffb099e04]::interface::run_compiler<core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>, rustc_driver[5c3b90d1fb3964ba]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
23: 0x7f7b0fe1b275 - <scoped_tls[393dd8f8fd825c8d]::ScopedKey<rustc_span[41a321a6411ba4fa]::SessionGlobals>>::set::<rustc_interface[65dcc5dffb099e04]::interface::run_compiler<core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>, rustc_driver[5c3b90d1fb3964ba]::run_compiler::{closure#1}>::{closure#0}, core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>>
24: 0x7f7b0fe1a862 - std[359ab902947f5f0b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[65dcc5dffb099e04]::util::run_in_thread_pool_with_globals<rustc_interface[65dcc5dffb099e04]::interface::run_compiler<core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>, rustc_driver[5c3b90d1fb3964ba]::run_compiler::{closure#1}>::{closure#0}, core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>>
25: 0x7f7b10513b7a - <<std[359ab902947f5f0b]::thread::Builder>::spawn_unchecked_<rustc_interface[65dcc5dffb099e04]::util::run_in_thread_pool_with_globals<rustc_interface[65dcc5dffb099e04]::interface::run_compiler<core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>, rustc_driver[5c3b90d1fb3964ba]::run_compiler::{closure#1}>::{closure#0}, core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6a29f2585b3d454]::result::Result<(), rustc_errors[d24ea2395205e4f0]::ErrorGuaranteed>>::{closure#1} as core[e6a29f2585b3d454]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
26: 0x7f7b0d972803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb77d8d72ebcf79c4
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/alloc/src/boxed.rs:2000:9
27: 0x7f7b0d972803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc08c3353e1568487
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/alloc/src/boxed.rs:2000:9
28: 0x7f7b0d972803 - std::sys::unix::thread::Thread::new::thread_start::h7168e596cd5e5ce6
at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys/unix/thread.rs:108:17
29: 0x7f7b0d71412d - start_thread
30: 0x7f7b0d795bc0 - clone3
31: 0x0 - <unknown>
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.67.1 (d5a82bbd2 2023-02-07) 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:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `a`
Caused by:
process didn't exit successfully: `rustc --crate-name a --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=ac6a6875d23a2206 -C extra-filename=-ac6a6875d23a2206 --out-dir /home/vimhax/Documents/Rust/Bug/target/debug/deps -C incremental=/home/vimhax/Documents/Rust/Bug/target/debug/incremental -L dependency=/home/vimhax/Documents/Rust/Bug/target/debug/deps --extern parking_lot=/home/vimhax/Documents/Rust/Bug/target/debug/deps/libparking_lot-1a014f3d0ef0901b.rlib` (signal: 6, SIGABRT: process abort signal)