Skip to content

error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds. #127163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SkippYoZ opened this issue Jun 30, 2024 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@SkippYoZ
Copy link

Hello !
I'm a fair beginner in Rust, so it could that I'm just a bit silly. None the less, the compiler said it would appreciate a bug report so here goes below. In my minimization I have removed anything that has to do with Serialization.

I did notice that using the latest nightly, the error now moves into a normal compiler error. So it might have been solved but I failed to find the issue that would relate to it.

Thanks all!

Code

/*
Cargo.toml:

[package]
name = "qpod"
version = "0.1.0"
edition = "2021"

[dependencies]
utoipa = { version = "4.2.3" }
*/

use std::collections::HashMap;

use utoipa::{
    openapi::{schema::Schema, ObjectBuilder, RefOr},
    ToSchema,
};

fn main() {
    ()
}

pub struct MarketDataContainer(pub HashMap<MktKey, MktData>);

impl<'__s> ToSchema<'__s> for MarketDataContainer {
    fn schema() -> (&'__s str, RefOr<Schema>) {
        (
            "MarketDataContainer",
            ObjectBuilder::new()
                .property("key", MktKey::schema())
                .required("key")
                .property("value", MktData::schema())
                .required("value")
                .to_array_builder()
                .into(),
        )
    }
}

#[derive(Hash, ToSchema)]
pub enum MktKey {
    This,
    That
}

#[derive(Debug, ToSchema)]
pub enum MktData {
    He,
    She
}

Meta

rustc --version --verbose:

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7

Error output

 % cargo build              
   Compiling qpod v0.1.0 (/home/matth/dev/rust/qpod)
error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds: '?6 utoipa::openapi::RefOr<utoipa::openapi::Schema>

thread 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:400:21:
Box<dyn Any>
stack backtrace:
   0:     0x7fcd8138c035 - std::backtrace_rs::backtrace::libunwind::trace::h1a07e5dba0da0cd2
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7fcd8138c035 - std::backtrace_rs::backtrace::trace_unsynchronized::h61b9b8394328c0bc
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fcd8138c035 - std::sys_common::backtrace::_print_fmt::h1c5e18b460934cff
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fcd8138c035 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1e1a1972118942ad
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fcd813db29b - core::fmt::rt::Argument::fmt::h07af2b4071d536cd
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/rt.rs:165:63
   5:     0x7fcd813db29b - core::fmt::write::hc090a2ffd6b28c4a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/mod.rs:1157:21
   6:     0x7fcd81380bdf - std::io::Write::write_fmt::h8898bac6ff039a23
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/io/mod.rs:1832:15
   7:     0x7fcd8138be0e - std::sys_common::backtrace::_print::h4e80c5803d4ee35b
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fcd8138be0e - std::sys_common::backtrace::print::ha96650907276675e
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fcd8138e779 - std::panicking::default_hook::{{closure}}::h215c2a0a8346e0e0
  10:     0x7fcd8138e4bd - std::panicking::default_hook::h207342be97478370
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:298:9
  11:     0x7fcd842891b7 - std[3c8ba8ebcf555201]::panicking::update_hook::<alloc[bfbae7e348dce413]::boxed::Box<rustc_driver_impl[c88438ade88661f4]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fcd8138ee76 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha9c3bc81d312fd83
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2036:9
  13:     0x7fcd8138ee76 - std::panicking::rust_panic_with_hook::hac8bdceee1e4fe2c
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:799:13
  14:     0x7fcd842b6b44 - std[3c8ba8ebcf555201]::panicking::begin_panic::<rustc_errors[80cf825e20fac581]::ExplicitBug>::{closure#0}
  15:     0x7fcd842b34f6 - std[3c8ba8ebcf555201]::sys_common::backtrace::__rust_end_short_backtrace::<std[3c8ba8ebcf555201]::panicking::begin_panic<rustc_errors[80cf825e20fac581]::ExplicitBug>::{closure#0}, !>
  16:     0x7fcd842aeb66 - std[3c8ba8ebcf555201]::panicking::begin_panic::<rustc_errors[80cf825e20fac581]::ExplicitBug>
  17:     0x7fcd842bff01 - <rustc_errors[80cf825e20fac581]::diagnostic::BugAbort as rustc_errors[80cf825e20fac581]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7fcd84739b1c - rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt::<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}
  19:     0x7fcd84720c2a - rustc_middle[3ff731b746e7b038]::ty::context::tls::with_opt::<rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7fcd84720acb - rustc_middle[3ff731b746e7b038]::ty::context::tls::with_context_opt::<rustc_middle[3ff731b746e7b038]::ty::context::tls::with_opt<rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7fcd82491740 - rustc_middle[3ff731b746e7b038]::util::bug::bug_fmt
  22:     0x7fcd861e0fe4 - <rustc_middle[3ff731b746e7b038]::ty::generic_args::GenericArg as rustc_infer[abd41066181445be]::infer::at::ToTrace>::to_trace
  23:     0x7fcd84cb5cfa - <rustc_infer[abd41066181445be]::infer::at::At>::eq::<rustc_middle[3ff731b746e7b038]::ty::generic_args::GenericArg>
  24:     0x7fcd84d9b0b6 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_similar_impl_candidates
  25:     0x7fcd84da55df - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::try_to_add_help_message
  26:     0x7fcd84d96970 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_selection_error
  27:     0x7fcd84da8102 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_fulfillment_error
  28:     0x7fcd84d920c0 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_fulfillment_errors
  29:     0x7fcd824a66ea - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_method_argument_types
  30:     0x7fcd860bc1d5 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7fcd860ba6a4 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:     0x7fcd860ba6a4 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7fcd860ba6a4 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7fcd860ba6a4 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35:     0x7fcd860ba6a4 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7fcd860b9060 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:     0x7fcd860b4bc6 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_block_with_expected
  38:     0x7fcd860ba64d - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7fcd85addc8c - rustc_hir_typeck[e95414a4bbf7473d]::check::check_fn
  40:     0x7fcd85ad2baf - rustc_hir_typeck[e95414a4bbf7473d]::typeck
  41:     0x7fcd85ad188d - rustc_query_impl[a12402620de91e8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a12402620de91e8]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 8usize]>>
  42:     0x7fcd857182b8 - rustc_query_system[4e189ce2c77124d]::query::plumbing::try_execute_query::<rustc_query_impl[a12402620de91e8]::DynamicConfig<rustc_query_system[4e189ce2c77124d]::query::caches::VecCache<rustc_span[8c7415e9d33ddd75]::def_id::LocalDefId, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a12402620de91e8]::plumbing::QueryCtxt, true>
  43:     0x7fcd8599308c - rustc_query_impl[a12402620de91e8]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  44:     0x7fcd85dca9b5 - rustc_hir_analysis[46a17d8846b4335f]::check_crate
  45:     0x7fcd85f890e0 - rustc_interface[640972162e3c086f]::passes::analysis
  46:     0x7fcd85f88aef - rustc_query_impl[a12402620de91e8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a12402620de91e8]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 1usize]>>
  47:     0x7fcd86471e53 - rustc_query_system[4e189ce2c77124d]::query::plumbing::try_execute_query::<rustc_query_impl[a12402620de91e8]::DynamicConfig<rustc_query_system[4e189ce2c77124d]::query::caches::SingleCache<rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[a12402620de91e8]::plumbing::QueryCtxt, true>
  48:     0x7fcd86471a9c - rustc_query_impl[a12402620de91e8]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  49:     0x7fcd86183149 - rustc_interface[640972162e3c086f]::interface::run_compiler::<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}
  50:     0x7fcd86140f8b - std[3c8ba8ebcf555201]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>
  51:     0x7fcd86140d80 - <<std[3c8ba8ebcf555201]::thread::Builder>::spawn_unchecked_<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#2} as core[868bc93c3f2beb33]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  52:     0x7fcd81398cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h09e5a4c541afa800
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  53:     0x7fcd81398cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9c8b03c22f4e7026
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  54:     0x7fcd81398cab - std::sys::pal::unix::thread::Thread::new::thread_start::h522bc89a54da820a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys/pal/unix/thread.rs:108:17
  55:     0x7fcd81140ac3 - <unknown>
  56:     0x7fcd811d2850 - <unknown>
  57:                0x0 - <unknown>

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.79.0 (129f3b996 2024-06-10) 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 [typeck] type-checking `<impl at src/main.rs:14:1: 14:50>::schema`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `qpod` (bin "qpod")
Backtrace

% RUST_BACKTRACE=1 cargo build
   Compiling qpod v0.1.0 (/home/matth/dev/rust/qpod)
error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds: '?6 utoipa::openapi::RefOr<utoipa::openapi::Schema>

thread 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:400:21:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::ty::generic_args::GenericArg as rustc_infer::infer::at::ToTrace>::to_trace
   7: <rustc_infer::infer::at::At>::eq::<rustc_middle::ty::generic_args::GenericArg>
   8: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_similar_impl_candidates
   9: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::try_to_add_help_message
  10: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_selection_error
  11: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_fulfillment_error
  12: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_fulfillment_errors
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_method_argument_types
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: rustc_hir_typeck::check::check_fn
  24: rustc_hir_typeck::typeck
      [... omitted 1 frame ...]
  25: rustc_hir_analysis::check_crate
  26: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  27: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.79.0 (129f3b996 2024-06-10) 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 [typeck] type-checking `<impl at src/main.rs:14:1: 14:50>::schema`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `qpod` (bin "qpod")

@SkippYoZ SkippYoZ added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 30, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 30, 2024
@pacak
Copy link
Contributor

pacak commented Jun 30, 2024

A smaller example with no external dependencies

enum Schema {}
struct ObjectBuilder;

impl ObjectBuilder {
    pub fn property<S, I: Into<RefOr<Schema>>>(self, property_name: S, component: I) {}
}
struct RefOr<T>(T);

trait ToSchema<'__s> {
    fn schema() -> (&str,);
}
impl<'a, T: ToSchema> From<T> for RefOr<Schema> {}
impl<'a> ToSchema<'a> for () {}

fn main() {
    ObjectBuilder.property("key", MktKey::schema())
}
struct MktKey;
impl<'a> ToSchema<'a> for MktKey {}

@theemathas
Copy link
Contributor

theemathas commented Jun 30, 2024

Minimized further:

trait IsPair<'a> {}  // formerly `ToSchema`
impl IsPair<'static> for (i32, i32) {}

trait AlsoIsPair<T> {}  // fromerly `Into`
struct Dummy;  // formerly `RefOr<Schema>`
impl<T: IsPair<'static>> AlsoIsPair<Dummy> for T {}

fn require_pair<T: AlsoIsPair<Dummy>>() {}  // formerly `ObjectBuilder.property`

fn main() {
    require_pair::<(i32, i32, i32)>()
}
Error output
   Compiling playground v0.0.1 (/playground)
error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds: 'static Dummy

thread 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:400:21:
Box<dyn Any>
stack backtrace:
   0:     0x7f140b64c035 - std::backtrace_rs::backtrace::libunwind::trace::h1a07e5dba0da0cd2
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f140b64c035 - std::backtrace_rs::backtrace::trace_unsynchronized::h61b9b8394328c0bc
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f140b64c035 - std::sys_common::backtrace::_print_fmt::h1c5e18b460934cff
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f140b64c035 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1e1a1972118942ad
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f140b69b29b - core::fmt::rt::Argument::fmt::h07af2b4071d536cd
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/rt.rs:165:63
   5:     0x7f140b69b29b - core::fmt::write::hc090a2ffd6b28c4a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/mod.rs:1157:21
   6:     0x7f140b640bdf - std::io::Write::write_fmt::h8898bac6ff039a23
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/io/mod.rs:1832:15
   7:     0x7f140b64be0e - std::sys_common::backtrace::_print::h4e80c5803d4ee35b
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f140b64be0e - std::sys_common::backtrace::print::ha96650907276675e
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f140b64e779 - std::panicking::default_hook::{{closure}}::h215c2a0a8346e0e0
  10:     0x7f140b64e4bd - std::panicking::default_hook::h207342be97478370
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:298:9
  11:     0x7f140e5491b7 - std[3c8ba8ebcf555201]::panicking::update_hook::<alloc[bfbae7e348dce413]::boxed::Box<rustc_driver_impl[c88438ade88661f4]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f140b64ee76 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha9c3bc81d312fd83
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2036:9
  13:     0x7f140b64ee76 - std::panicking::rust_panic_with_hook::hac8bdceee1e4fe2c
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:799:13
  14:     0x7f140e576b44 - std[3c8ba8ebcf555201]::panicking::begin_panic::<rustc_errors[80cf825e20fac581]::ExplicitBug>::{closure#0}
  15:     0x7f140e5734f6 - std[3c8ba8ebcf555201]::sys_common::backtrace::__rust_end_short_backtrace::<std[3c8ba8ebcf555201]::panicking::begin_panic<rustc_errors[80cf825e20fac581]::ExplicitBug>::{closure#0}, !>
  16:     0x7f140e56eb66 - std[3c8ba8ebcf555201]::panicking::begin_panic::<rustc_errors[80cf825e20fac581]::ExplicitBug>
  17:     0x7f140e57ff01 - <rustc_errors[80cf825e20fac581]::diagnostic::BugAbort as rustc_errors[80cf825e20fac581]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f140e9f9b1c - rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt::<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}
  19:     0x7f140e9e0c2a - rustc_middle[3ff731b746e7b038]::ty::context::tls::with_opt::<rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f140e9e0acb - rustc_middle[3ff731b746e7b038]::ty::context::tls::with_context_opt::<rustc_middle[3ff731b746e7b038]::ty::context::tls::with_opt<rustc_middle[3ff731b746e7b038]::util::bug::opt_span_bug_fmt<rustc_span[8c7415e9d33ddd75]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f140c751740 - rustc_middle[3ff731b746e7b038]::util::bug::bug_fmt
  22:     0x7f14104a0fe4 - <rustc_middle[3ff731b746e7b038]::ty::generic_args::GenericArg as rustc_infer[abd41066181445be]::infer::at::ToTrace>::to_trace
  23:     0x7f140ef75cfa - <rustc_infer[abd41066181445be]::infer::at::At>::eq::<rustc_middle[3ff731b746e7b038]::ty::generic_args::GenericArg>
  24:     0x7f140f05b0b6 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_similar_impl_candidates
  25:     0x7f140f0655df - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::try_to_add_help_message
  26:     0x7f140f056970 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_selection_error
  27:     0x7f140f068102 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_fulfillment_error
  28:     0x7f140f0520c0 - <rustc_infer[abd41066181445be]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[173dcaf5d960508e]::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_fulfillment_errors
  29:     0x7f140ce663e8 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::confirm_builtin_call
  30:     0x7f141037a130 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7f1410374bc6 - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_block_with_expected
  32:     0x7f141037a64d - <rustc_hir_typeck[e95414a4bbf7473d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7f140fd9dc8c - rustc_hir_typeck[e95414a4bbf7473d]::check::check_fn
  34:     0x7f140fd92baf - rustc_hir_typeck[e95414a4bbf7473d]::typeck
  35:     0x7f140fd9188d - rustc_query_impl[a12402620de91e8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a12402620de91e8]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 8usize]>>
  36:     0x7f140f9d5f2d - rustc_query_system[4e189ce2c77124d]::query::plumbing::try_execute_query::<rustc_query_impl[a12402620de91e8]::DynamicConfig<rustc_query_system[4e189ce2c77124d]::query::caches::VecCache<rustc_span[8c7415e9d33ddd75]::def_id::LocalDefId, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a12402620de91e8]::plumbing::QueryCtxt, false>
  37:     0x7f140f9d5924 - rustc_query_impl[a12402620de91e8]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  38:     0x7f141008a9b5 - rustc_hir_analysis[46a17d8846b4335f]::check_crate
  39:     0x7f14102490e0 - rustc_interface[640972162e3c086f]::passes::analysis
  40:     0x7f1410248aef - rustc_query_impl[a12402620de91e8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a12402620de91e8]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 1usize]>>
  41:     0x7f14105a2022 - rustc_query_system[4e189ce2c77124d]::query::plumbing::try_execute_query::<rustc_query_impl[a12402620de91e8]::DynamicConfig<rustc_query_system[4e189ce2c77124d]::query::caches::SingleCache<rustc_middle[3ff731b746e7b038]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[a12402620de91e8]::plumbing::QueryCtxt, false>
  42:     0x7f14105a1dc9 - rustc_query_impl[a12402620de91e8]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7f1410443149 - rustc_interface[640972162e3c086f]::interface::run_compiler::<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}
  44:     0x7f1410400f8b - std[3c8ba8ebcf555201]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>
  45:     0x7f1410400d80 - <<std[3c8ba8ebcf555201]::thread::Builder>::spawn_unchecked_<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#2} as core[868bc93c3f2beb33]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f140b658cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h09e5a4c541afa800
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  47:     0x7f140b658cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9c8b03c22f4e7026
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  48:     0x7f140b658cab - std::sys::pal::unix::thread::Thread::new::thread_start::h522bc89a54da820a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys/pal/unix/thread.rs:108:17
  49:     0x7f140b566609 - start_thread
  50:     0x7f140b489353 - clone
  51:                0x0 - <unknown>

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.79.0 (129f3b996 2024-06-10) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

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

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground` (bin "playground")

ICEs on stable 1.79.0. Produces a normal error on nightly (2024-06-24 6b0f4b5).

Probably a duplicate of #126129.

@compiler-errors
Copy link
Member

Since this is fixed on nightly, I don't think it's worthwhile to keep tracking this as an open bug. Sorry that you hit this bug!!

@compiler-errors compiler-errors closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants