<p dir="auto">I'm on Arch Linux x86_64, I configured the compiler with plain <code class="notranslate">./configure</code>, on commit <code class="notranslate">6d8342f5e9f7093694548e761ee7df4f55243f3f</code>. While the build is on this step:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc"><pre class="notranslate"><code class="notranslate">rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc
</code></pre></div>
<p dir="auto">I get this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: Type metadata for unique id '{&amp;{&amp;[]{struct dbb1b1faf5a54dab/2157e}}}' is already in the TypeMap!`"><pre class="notranslate"><code class="notranslate">error: internal compiler error: Type metadata for unique id '{&amp;{&amp;[]{struct dbb1b1faf5a54dab/2157e}}}' is already in the TypeMap!`
</code></pre></div>
<p dir="auto">With this backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stack backtrace:
   1:     0x7f4f637f4030 - rt::backtrace::imp::write::hd68321808750660aVJp::v0.11.0.pre
   2:     0x7f4f637face0 - failure::on_fail::h154edd018f1bf2ddb5p::v0.11.0.pre
   3:     0x7f4f63f94990 - unwind::begin_unwind_inner::hd705cb6b794f80b52Sd::v0.11.0.pre
   4:     0x7f4f628f9900 - unwind::begin_unwind::h9854036616545136218::v0.11.0.pre
   5:     0x7f4f628fa380 - diagnostic::Handler::bug::hf4942befc9aaa08ae4b::v0.11.0.pre
   6:     0x7f4f6466b9b0 - driver::session::Session::bug::h62d28c74abdced97a9w::v0.11.0.pre
   7:     0x7f4f647bce50 - middle::trans::debuginfo::TypeMap::register_unique_id_with_metadata::ha322802a27d8506auxB::v0.11.0.pre
   8:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
   9:     0x7f4f647d1db0 - middle::trans::debuginfo::MemberDescriptionFactory::create_member_descriptions::hbb82ea95bc203ed8S2C::v0.11.0.pre
  10:     0x7f4f647d4770 - middle::trans::debuginfo::RecursiveTypeDescription::finalize::h172a9c81d3fa73fb14C::v0.11.0.pre
  11:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  12:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  13:     0x7f4f647dd760 - middle::trans::debuginfo::subroutine_type_metadata::hab304051bb4931acO3D::v0.11.0.pre
  14:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  15:     0x7f4f64756650 - middle::trans::debuginfo::create_function_debug_context::h551395b1c8ceede8BmC::v0.11.0.pre
  16:     0x7f4f646bd4f0 - middle::trans::base::new_fn_ctxt::h14929bd3a73789b8Naq::v0.11.0.pre
  17:     0x7f4f6475b340 - middle::trans::base::trans_closure::h65a687f94d00498fSoq::v0.11.0.pre
  18:     0x7f4f6466cd40 - middle::trans::base::trans_fn::hdc8f7c61ccd79580Vwq::v0.11.0.pre
  19:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  20:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  21:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  22:     0x7f4f646a0460 - visit::walk_expr::h17947220027483757976::v0.11.0.pre
  23:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  24:     0x7f4f646a1fe0 - visit::Visitor::visit_fn::h2285760730414270531::v0.11.0.pre
  25:     0x7f4f647610f0 - middle::trans::meth::trans_impl::h6256bcdcefe94055Rtw::v0.11.0.pre
  26:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  27:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  28:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  29:     0x7f4f6476b520 - middle::trans::base::trans_crate::ha8449dece161a4f80Gr::v0.11.0.pre
  30:     0x7f4f64f650f0 - driver::driver::phase_4_translate_to_llvm::h3205c42d1e774d83Hjw::v0.11.0.pre
  31:     0x7f4f64f59d70 - driver::driver::compile_input::h9565f67bca8cc63dLYv::v0.11.0.pre
  32:     0x7f4f65019ef0 - driver::run_compiler::h3c56844536e03c3cLGy::v0.11.0.pre
  33:     0x7f4f65019df0 - driver::main_args::closure.117369
  34:     0x7f4f65033d30 - driver::monitor::closure.118564
  35:     0x7f4f6502eef0 - task::TaskBuilder::try::closure.118289
  36:     0x7f4f6700dff0 - task::spawn_opts::closure.7590
  37:     0x7f4f63f914f0 - task::Task::run::closure.5350
  38:     0x7f4f64004cc0 - rust_try
  39:     0x7f4f63f93f20 - unwind::try::he7a8528ce77e1217oHd::v0.11.0.pre
  40:     0x7f4f63f91350 - task::Task::run::hb15978d9de89989eHWc::v0.11.0.pre
  41:     0x7f4f6700ddb0 - task::spawn_opts::closure.7561
  42:     0x7f4f63f93580 - thread::thread_start::h3040a1afbabdead5bed::v0.11.0.pre
  43:     0x7f4f63276060 - start_thread
  44:     0x7f4f63c68489 - __clone
  45:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">stack backtrace:
   1:     0x7f4f637f4030 - rt::backtrace::imp::write::hd68321808750660aVJp::v0.11.0.pre
   2:     0x7f4f637face0 - failure::on_fail::h154edd018f1bf2ddb5p::v0.11.0.pre
   3:     0x7f4f63f94990 - unwind::begin_unwind_inner::hd705cb6b794f80b52Sd::v0.11.0.pre
   4:     0x7f4f628f9900 - unwind::begin_unwind::h9854036616545136218::v0.11.0.pre
   5:     0x7f4f628fa380 - diagnostic::Handler::bug::hf4942befc9aaa08ae4b::v0.11.0.pre
   6:     0x7f4f6466b9b0 - driver::session::Session::bug::h62d28c74abdced97a9w::v0.11.0.pre
   7:     0x7f4f647bce50 - middle::trans::debuginfo::TypeMap::register_unique_id_with_metadata::ha322802a27d8506auxB::v0.11.0.pre
   8:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
   9:     0x7f4f647d1db0 - middle::trans::debuginfo::MemberDescriptionFactory::create_member_descriptions::hbb82ea95bc203ed8S2C::v0.11.0.pre
  10:     0x7f4f647d4770 - middle::trans::debuginfo::RecursiveTypeDescription::finalize::h172a9c81d3fa73fb14C::v0.11.0.pre
  11:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  12:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  13:     0x7f4f647dd760 - middle::trans::debuginfo::subroutine_type_metadata::hab304051bb4931acO3D::v0.11.0.pre
  14:     0x7f4f647c85e0 - middle::trans::debuginfo::type_metadata::ha6587b278ab9472c87D::v0.11.0.pre
  15:     0x7f4f64756650 - middle::trans::debuginfo::create_function_debug_context::h551395b1c8ceede8BmC::v0.11.0.pre
  16:     0x7f4f646bd4f0 - middle::trans::base::new_fn_ctxt::h14929bd3a73789b8Naq::v0.11.0.pre
  17:     0x7f4f6475b340 - middle::trans::base::trans_closure::h65a687f94d00498fSoq::v0.11.0.pre
  18:     0x7f4f6466cd40 - middle::trans::base::trans_fn::hdc8f7c61ccd79580Vwq::v0.11.0.pre
  19:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  20:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  21:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  22:     0x7f4f646a0460 - visit::walk_expr::h17947220027483757976::v0.11.0.pre
  23:     0x7f4f646a1500 - visit::Visitor::visit_block::h10191743604182817780::v0.11.0.pre
  24:     0x7f4f646a1fe0 - visit::Visitor::visit_fn::h2285760730414270531::v0.11.0.pre
  25:     0x7f4f647610f0 - middle::trans::meth::trans_impl::h6256bcdcefe94055Rtw::v0.11.0.pre
  26:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  27:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  28:     0x7f4f64666010 - middle::trans::base::trans_item::h0d2beb0c7408fa1fnNq::v0.11.0.pre
  29:     0x7f4f6476b520 - middle::trans::base::trans_crate::ha8449dece161a4f80Gr::v0.11.0.pre
  30:     0x7f4f64f650f0 - driver::driver::phase_4_translate_to_llvm::h3205c42d1e774d83Hjw::v0.11.0.pre
  31:     0x7f4f64f59d70 - driver::driver::compile_input::h9565f67bca8cc63dLYv::v0.11.0.pre
  32:     0x7f4f65019ef0 - driver::run_compiler::h3c56844536e03c3cLGy::v0.11.0.pre
  33:     0x7f4f65019df0 - driver::main_args::closure.117369
  34:     0x7f4f65033d30 - driver::monitor::closure.118564
  35:     0x7f4f6502eef0 - task::TaskBuilder::try::closure.118289
  36:     0x7f4f6700dff0 - task::spawn_opts::closure.7590
  37:     0x7f4f63f914f0 - task::Task::run::closure.5350
  38:     0x7f4f64004cc0 - rust_try
  39:     0x7f4f63f93f20 - unwind::try::he7a8528ce77e1217oHd::v0.11.0.pre
  40:     0x7f4f63f91350 - task::Task::run::hb15978d9de89989eHWc::v0.11.0.pre
  41:     0x7f4f6700ddb0 - task::spawn_opts::closure.7561
  42:     0x7f4f63f93580 - thread::thread_start::h3040a1afbabdead5bed::v0.11.0.pre
  43:     0x7f4f63276060 - start_thread
  44:     0x7f4f63c68489 - __clone
  45:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">Compiling libcore with -g leads to the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: Type metadata for ty::t '&amp;[core::fmt::rt::Piece&lt;&gt;]' is already in the TypeMap!"><pre class="notranslate"><code class="notranslate">error: internal compiler error: Type metadata for ty::t '&amp;[core::fmt::rt::Piece&lt;&gt;]' is already in the TypeMap!
</code></pre></div>
<p dir="auto">This is due to the vec slice in question occurring multiple times along a type reference chain and the code path for vec slices doesn't take that possibility into account. This is also a potential problem for other kinds of types, e.g. fixed length vector types or function types. For regular pointer types this is already handled correctly.</p>