Skip to content

Nightly Complier error "should have just one matching element" #93797

Closed
@hasezoey

Description

@hasezoey

Code

Some code that uses crate [email protected]

Meta

rustc --version --verbose:

nightly-x86_64-unknown-linux-gnu installed - rustc 1.60.0-nightly (0c292c966 2022-02-08)

Error output

    Compiling guppy v0.7.2
thread 'rustc' panicked at 'Collection VecMap(
    [
        (
            OpaqueTypeKey {
                def_id: DefId(0:250 ~ guppy[2229]::graph::build::{impl#4}::resolve::{opaque#0}),
                substs: [
                    ReStatic,
                    ReEarlyBound(0, 'g),
                    ReFree(DefId(0:248 ~ guppy[2229]::graph::build::{impl#4}::resolve), BrNamed(DefId(0:249 ~ guppy[2229]::graph::build::{impl#4}::resolve::'a), 'a)),
                ],
            },
            impl std::iter::Iterator<Item = &'g cargo_metadata::Dependency>,
        ),
        (
            OpaqueTypeKey {
                def_id: DefId(0:250 ~ guppy[2229]::graph::build::{impl#4}::resolve::{opaque#0}),
                substs: [
                    ReStatic,
                    ReEarlyBound(0, 'g),
                    ReFree(DefId(0:248 ~ guppy[2229]::graph::build::{impl#4}::resolve), BrNamed(DefId(0:249 ~ guppy[2229]::graph::build::{impl#4}::resolve::'a), 'a)),
                ],
            },
            impl std::iter::Iterator<Item = &'g cargo_metadata::Dependency>,
        ),
    ],
) should have just one matching element', /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/compiler/rustc_data_structures/src/vec_map.rs:73:9
stack backtrace:
   0:     0x7fc7e56039fc - std::backtrace_rs::backtrace::libunwind::trace::hef696c91488c46df
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fc7e56039fc - std::backtrace_rs::backtrace::trace_unsynchronized::h76c93ef0698d26b2
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc7e56039fc - std::sys_common::backtrace::_print_fmt::h93575aa503bf6e1b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fc7e56039fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h40967adecfbc037b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fc7e56650dc - core::fmt::write::h03044e853df7d223
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/core/src/fmt/mod.rs:1190:17
   5:     0x7fc7e55f3d28 - std::io::Write::write_fmt::h86bffabfad56f13c
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/io/mod.rs:1657:15
   6:     0x7fc7e5607977 - std::sys_common::backtrace::_print::hd28d8aed16472cc0
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fc7e5607977 - std::sys_common::backtrace::print::h8f98cdd641cb45a3
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fc7e5607977 - std::panicking::default_hook::{{closure}}::h729dcf0a13bd0685
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:295:22
   9:     0x7fc7e560763f - std::panicking::default_hook::h5f6c637024d9ad69
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:314:9
  10:     0x7fc7e5de9681 - rustc_driver[a83f25a8e01ca780]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fc7d6625ae9 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h72f1f3dff81812e9
  12:     0x7fc7d668bf34 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h321b0b11bf6269eb
  13:     0x7fc7d66e3ed6 - std::panicking::update_hook::{{closure}}::hd713bb8cbf026711
  14:     0x7fc7e5608255 - std::panicking::rust_panic_with_hook::h46cff6766bf99e7c
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:702:17
  15:     0x7fc7e5607f07 - std::panicking::begin_panic_handler::{{closure}}::h0e775b2aa2b67693
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:588:13
  16:     0x7fc7e5603ea4 - std::sys_common::backtrace::__rust_end_short_backtrace::h1863dd104b065b9d
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:138:18
  17:     0x7fc7e5607c09 - rust_begin_unwind
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:584:5
  18:     0x7fc7e55cfb93 - core::panicking::panic_fmt::hfdeb0fcb6ce506f4
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/core/src/panicking.rs:143:14
  19:     0x7fc7e7298d68 - rustc_typeck[6ad013c86309b894]::collect::type_of::type_of
  20:     0x7fc7e771cd9d - <rustc_query_impl[d4f8e842d33b757d]::Queries as rustc_middle[65c9065df24d66dd]::ty::query::QueryEngine>::type_of
  21:     0x7fc7e72c09e8 - rustc_typeck[6ad013c86309b894]::check::check::check_item_type
  22:     0x7fc7e727efa7 - <rustc_middle[65c9065df24d66dd]::hir::map::Map>::visit_item_likes_in_module::<rustc_typeck[6ad013c86309b894]::check::CheckItemTypesVisitor>
  23:     0x7fc7e7f6036c - rustc_typeck[6ad013c86309b894]::check::check::check_mod_item_types
  24:     0x7fc7e76c7d8e - rustc_query_system[7ba0bb8d62d59e6f]::query::plumbing::try_execute_query::<rustc_query_impl[d4f8e842d33b757d]::plumbing::QueryCtxt, rustc_query_system[7ba0bb8d62d59e6f]::query::caches::DefaultCache<rustc_span[20d03c4744d90449]::def_id::LocalDefId, ()>>
  25:     0x7fc7e81653f3 - rustc_query_system[7ba0bb8d62d59e6f]::query::plumbing::get_query::<rustc_query_impl[d4f8e842d33b757d]::queries::check_mod_item_types, rustc_query_impl[d4f8e842d33b757d]::plumbing::QueryCtxt>
  26:     0x7fc7e7f32630 - <rustc_middle[65c9065df24d66dd]::hir::map::Map>::for_each_module::<rustc_typeck[6ad013c86309b894]::check_crate::{closure#6}::{closure#0}>
  27:     0x7fc7e7ef8a30 - <rustc_session[3b88a4bcbf196e76]::session::Session>::time::<(), rustc_typeck[6ad013c86309b894]::check_crate::{closure#6}>
  28:     0x7fc7e7ef5ad3 - rustc_typeck[6ad013c86309b894]::check_crate
  29:     0x7fc7e7c97127 - rustc_interface[9582d0c3479cfa46]::passes::analysis
  30:     0x7fc7e8134209 - rustc_query_system[7ba0bb8d62d59e6f]::query::plumbing::try_execute_query::<rustc_query_impl[d4f8e842d33b757d]::plumbing::QueryCtxt, rustc_query_system[7ba0bb8d62d59e6f]::query::caches::DefaultCache<(), core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>>
  31:     0x7fc7e81723f5 - rustc_query_system[7ba0bb8d62d59e6f]::query::plumbing::get_query::<rustc_query_impl[d4f8e842d33b757d]::queries::analysis, rustc_query_impl[d4f8e842d33b757d]::plumbing::QueryCtxt>
  32:     0x7fc7e7c6d86d - <rustc_interface[9582d0c3479cfa46]::passes::QueryContext>::enter::<rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>
  33:     0x7fc7e7c6b92a - <rustc_interface[9582d0c3479cfa46]::interface::Compiler>::enter::<rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}::{closure#2}, core[efe43fe86f1c620a]::result::Result<core[efe43fe86f1c620a]::option::Option<rustc_interface[9582d0c3479cfa46]::queries::Linker>, rustc_errors[6e799cab4439a167]::ErrorReported>>
  34:     0x7fc7e7c6e8dc - rustc_span[20d03c4744d90449]::with_source_map::<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_interface[9582d0c3479cfa46]::interface::create_compiler_and_run<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#1}>
  35:     0x7fc7e7c6b2d3 - rustc_interface[9582d0c3479cfa46]::interface::create_compiler_and_run::<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>
  36:     0x7fc7e7c514e2 - std[3d6e7d7423cf4afe]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9582d0c3479cfa46]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[9582d0c3479cfa46]::interface::run_compiler<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>
  37:     0x7fc7e7c4ec29 - <<std[3d6e7d7423cf4afe]::thread::Builder>::spawn_unchecked_<rustc_interface[9582d0c3479cfa46]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[9582d0c3479cfa46]::interface::run_compiler<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#1} as core[efe43fe86f1c620a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7fc7e5613ca3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf9ab37ec9b510857
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/alloc/src/boxed.rs:1854:9
  39:     0x7fc7e5613ca3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha1991051ebf83b9d
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/alloc/src/boxed.rs:1854:9
  40:     0x7fc7e5613ca3 - std::sys::unix::thread::Thread::new::thread_start::h5d1d180c2a38668b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7fc7e553d609 - start_thread
  42:     0x7fc7e5457293 - clone
  43:                0x0 - <unknown>

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.60.0-nightly (0c292c966 2022-02-08) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_of] computing type of `graph::build::<impl at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/guppy-0.7.2/src/graph/build.rs:478:1: 589:2>::resolve::{opaque#0}`
#1 [check_mod_item_types] checking item types in module `graph::build`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `guppy`
warning: build failed, waiting for other jobs to finish...
error: failed to compile `semantic-release-rust v1.0.0-alpha.8`, intermediate artifacts can be found at `/tmp/cargo-installRzF03e`

Caused by:
  build failed
Error: Process completed with exit code 101.
<backtrace>


I noticed that my github actions failed while trying to compile guppy with the nightly compiler

Github CI Run: https://github.com/hasezoey/new_string_template/runs/5122745994

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-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