Skip to content

ICE: type metadata for unique ID VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst) is already in the TypeMap! #105822

Open
@Ruben2424

Description

@Ruben2424

Code

The error occurs when compiling tests in https://github.com/hyperium/h3.
I am sorry but I wasn't able to create a minimized example.
But I found out that without this function call (and the same function calls in similar tests) the error don't occur.
https://github.com/hyperium/h3/blob/885144bfcb0414bcb86b63cec9c65a611c7e56ee/h3/src/tests/connection.rs#L586 .

Meta

rustc --version --verbose:

rustc 1.67.0-beta.2 (352eb59a4 2022-12-13)
binary: rustc
commit-hash: 352eb59a4c33abf739914422f2ad975925750146
commit-date: 2022-12-13
host: x86_64-unknown-linux-gnu
release: 1.67.0-beta.2
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs:133:13: type metadata for unique ID 'VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst)' is already in the `TypeMap`!
Backtrace

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs:133:13: type metadata for unique ID 'VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst)' is already in the `TypeMap`!

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/352eb59a4c33abf739914422f2ad975925750146/compiler/rustc_errors/src/lib.rs:1576:9
stack backtrace:
   0:     0x7fef9277967a - std::backtrace_rs::backtrace::libunwind::trace::hcd4891e18cdac4cb
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fef9277967a - std::backtrace_rs::backtrace::trace_unsynchronized::ha58ab820c4658994
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fef9277967a - std::sys_common::backtrace::_print_fmt::he568d92119f87d54
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fef9277967a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcbc847301a6787b7
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fef8e6f325e - core::fmt::write::h2fc64d22f72fd459
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/core/src/fmt/mod.rs:1208:17
   5:     0x7fef9276d4a5 - std::io::Write::write_fmt::h7541c526a11333b7
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/io/mod.rs:1682:15
   6:     0x7fef92779445 - std::sys_common::backtrace::_print::hbd71aef4fc6cae4a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fef92779445 - std::sys_common::backtrace::print::hafe0948995637b97
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fef9277b7cf - std::panicking::default_hook::{{closure}}::h45f78efd81105148
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:267:22
   9:     0x7fef9277b50b - std::panicking::default_hook::h5d914794caf2ae06
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:286:9
  10:     0x7fef919c63e1 - rustc_driver[7be1e2c8384e391a]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fef9277bfcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h68a829533092086a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2032:9
  12:     0x7fef9277bfcd - std::panicking::rust_panic_with_hook::h81cbe204a0e9dbb4
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:692:13
  13:     0x7fef91e4f9f1 - std[1420c78fae8005f4]::panicking::begin_panic::<rustc_errors[22c30192bd34e832]::ExplicitBug>::{closure#0}
  14:     0x7fef91e4f2c6 - std[1420c78fae8005f4]::sys_common::backtrace::__rust_end_short_backtrace::<std[1420c78fae8005f4]::panicking::begin_panic<rustc_errors[22c30192bd34e832]::ExplicitBug>::{closure#0}, !>
  15:     0x7fef91e880d6 - std[1420c78fae8005f4]::panicking::begin_panic::<rustc_errors[22c30192bd34e832]::ExplicitBug>
  16:     0x7fef91e4cbe6 - std[1420c78fae8005f4]::panic::panic_any::<rustc_errors[22c30192bd34e832]::ExplicitBug>
  17:     0x7fef91e4b9a6 - <rustc_errors[22c30192bd34e832]::HandlerInner>::bug::<&alloc[2bbbf4664cc293fb]::string::String>
  18:     0x7fef91e4b610 - <rustc_errors[22c30192bd34e832]::Handler>::bug::<&alloc[2bbbf4664cc293fb]::string::String>
  19:     0x7fef91e2d2ae - rustc_middle[6f44b2edfca54a7c]::ty::context::tls::with_context_opt::<rustc_middle[6f44b2edfca54a7c]::ty::context::tls::with_opt<rustc_middle[6f44b2edfca54a7c]::util::bug::opt_span_bug_fmt<rustc_span[9a3cb0e49fef3da0]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7fef91e2e716 - rustc_middle[6f44b2edfca54a7c]::util::bug::opt_span_bug_fmt::<rustc_span[9a3cb0e49fef3da0]::span_encoding::Span>
  21:     0x7fef8fc3d783 - rustc_middle[6f44b2edfca54a7c]::util::bug::bug_fmt
  22:     0x7fef9125ba26 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::TypeMap>::insert
  23:     0x7fef918487b6 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node::{closure#0}, rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node::{closure#1}>
  24:     0x7fef91827a24 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node
  25:     0x7fef917f600a - <&mut rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}::{closure#0} as core[b9c1de13ce1671c0]::ops::function::FnOnce<(rustc_target[9c8ec14b4338e81c]::abi::VariantIdx,)>>::call_once
  26:     0x7fef918379fa - <smallvec[2a35e75d77540254]::SmallVec<[rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::VariantMemberInfo; 16usize]> as core[b9c1de13ce1671c0]::iter::traits::collect::Extend<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::VariantMemberInfo>>::extend::<core[b9c1de13ce1671c0]::iter::adapters::map::Map<core[b9c1de13ce1671c0]::iter::adapters::map::Map<core[b9c1de13ce1671c0]::ops::range::Range<usize>, <rustc_index[a6e905da1e73ca79]::vec::IndexVec<rustc_target[9c8ec14b4338e81c]::abi::VariantIdx, rustc_abi[87f217d803b9d4b]::LayoutS<rustc_target[9c8ec14b4338e81c]::abi::VariantIdx>>>::indices::{closure#0}>, rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}::{closure#0}>>
  27:     0x7fef91848f9f - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}, for<'a, 'b, 'c> fn(&'a rustc_codegen_llvm[3f3b4ba1dcec146e]::context::CodegenCx<'b, 'c>) -> smallvec[2a35e75d77540254]::SmallVec<[&'b rustc_codegen_llvm[3f3b4ba1dcec146e]::llvm_::ffi::Metadata; 16usize]>>
  28:     0x7fef917f9591 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node
  29:     0x7fef918270ff - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_di_node
  30:     0x7fef9013705b - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_di_node
  31:     0x7fef90053199 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::context::CodegenCx as rustc_codegen_ssa[5366641906a838a4]::traits::debuginfo::DebugInfoMethods>::create_dbg_var
  32:     0x7fef90048602 - rustc_codegen_ssa[5366641906a838a4]::mir::codegen_mir::<rustc_codegen_llvm[3f3b4ba1dcec146e]::builder::Builder>
  33:     0x7fef90ce00c3 - rustc_codegen_llvm[3f3b4ba1dcec146e]::base::compile_codegen_unit::module_codegen
  34:     0x7fef91043a57 - <rustc_query_system[7b71e87695234a12]::dep_graph::graph::DepGraph<rustc_middle[6f44b2edfca54a7c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6f44b2edfca54a7c]::ty::context::TyCtxt, rustc_span[9a3cb0e49fef3da0]::symbol::Symbol, rustc_codegen_ssa[5366641906a838a4]::ModuleCodegen<rustc_codegen_llvm[3f3b4ba1dcec146e]::ModuleLlvm>>
  35:     0x7fef91043511 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend as rustc_codegen_ssa[5366641906a838a4]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  36:     0x7fef91040db2 - rustc_codegen_ssa[5366641906a838a4]::base::codegen_crate::<rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend>
  37:     0x7fef91040559 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend as rustc_codegen_ssa[5366641906a838a4]::traits::backend::CodegenBackend>::codegen_crate
  38:     0x7fef90b403b1 - <rustc_session[9f2eda86fa5de41f]::session::Session>::time::<alloc[2bbbf4664cc293fb]::boxed::Box<dyn core[b9c1de13ce1671c0]::any::Any>, rustc_interface[b55cc7e3edc32fa9]::passes::start_codegen::{closure#0}>
  39:     0x7fef90b3fed9 - rustc_interface[b55cc7e3edc32fa9]::passes::start_codegen
  40:     0x7fef90b3dbb6 - <rustc_interface[b55cc7e3edc32fa9]::passes::QueryContext>::enter::<<rustc_interface[b55cc7e3edc32fa9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<alloc[2bbbf4664cc293fb]::boxed::Box<dyn core[b9c1de13ce1671c0]::any::Any>, rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  41:     0x7fef90b3b1f6 - <rustc_interface[b55cc7e3edc32fa9]::queries::Queries>::ongoing_codegen
  42:     0x7fef90b3a717 - <rustc_interface[b55cc7e3edc32fa9]::interface::Compiler>::enter::<rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}::{closure#2}, core[b9c1de13ce1671c0]::result::Result<core[b9c1de13ce1671c0]::option::Option<rustc_interface[b55cc7e3edc32fa9]::queries::Linker>, rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  43:     0x7fef90b35738 - rustc_span[9a3cb0e49fef3da0]::with_source_map::<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  44:     0x7fef90b35225 - <scoped_tls[5e88bebcbbbb855e]::ScopedKey<rustc_span[9a3cb0e49fef3da0]::SessionGlobals>>::set::<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  45:     0x7fef90b34812 - std[1420c78fae8005f4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b55cc7e3edc32fa9]::util::run_in_thread_pool_with_globals<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  46:     0x7fef91279618 - <<std[1420c78fae8005f4]::thread::Builder>::spawn_unchecked_<rustc_interface[b55cc7e3edc32fa9]::util::run_in_thread_pool_with_globals<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#1} as core[b9c1de13ce1671c0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7fef92783313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h505d44b0a4d2868a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2000:9
  48:     0x7fef92783313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h83bbe20ed8f689ab
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2000:9
  49:     0x7fef92783313 - std::sys::unix::thread::Thread::new::thread_start::hbc564e93ad1dfe6f
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7fef8e3d8b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  51:     0x7fef8e46aa00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  52:                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.0-beta.2 (352eb59a4 2022-12-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -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
error: could not compile `h3`
<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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