Skip to content
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

ICE when building console-subscriber #124082

Closed
ChrisGreenaway opened this issue Apr 17, 2024 · 1 comment
Closed

ICE when building console-subscriber #124082

ChrisGreenaway opened this issue Apr 17, 2024 · 1 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.

Comments

@ChrisGreenaway
Copy link

Code

Add the following dependency to a fresh Rust project:

console-subscriber = "0.2.0"

and run:

cargo +nightly build 

Meta

rustc +nightly --version --verbose:

rustc 1.79.0-nightly (1cec373f6 2024-04-16)
binary: rustc
commit-hash: 1cec373f65eb76e8e4b4d1847213cf3ec6c292b6
commit-date: 2024-04-16
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.3

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/mod.rs:956:17: opaque types got hidden types registered from within subtype predicate: tracing_subscriber::layer::Layered<Alias(Opaque, AliasTy { args: [tracing_subscriber::Registry], def_id: DefId(0:1540 ~ console_subscriber[d8e0]::builder::{impl#1}::spawn::{opaque#0}) }), tracing_subscriber::Registry, tracing_subscriber::Registry> vs tracing_subscriber::layer::Layered<Alias(Opaque, AliasTy { args: [tracing_subscriber::Registry], def_id: DefId(0:1540 ~ console_subscriber[d8e0]::builder::{impl#1}::spawn::{opaque#0}) }), tracing_subscriber::Registry, tracing_subscriber::Registry>
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/src/builder.rs:407:19
    |
407 |             .with(tracing_subscriber::fmt::layer().with_filter(fmt_filter))
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_infer/src/infer/mod.rs:956:17:
Box<dyn Any>
stack backtrace:
   0:     0x7f6f4f98ccd5 - std::backtrace_rs::backtrace::libunwind::trace::h39aa7bbcf61112e7
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f6f4f98ccd5 - std::backtrace_rs::backtrace::trace_unsynchronized::h8cbdf27e1140b5c7
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6f4f98ccd5 - std::sys_common::backtrace::_print_fmt::hf30f89c5893a63c3
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f6f4f98ccd5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8ae58e1a025dc15e
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f6f4f9dbf9b - core::fmt::rt::Argument::fmt::h79663960ec3ead41
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/core/src/fmt/rt.rs:165:63
   5:     0x7f6f4f9dbf9b - core::fmt::write::hea0bc3323f37fb37
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/core/src/fmt/mod.rs:1157:21
   6:     0x7f6f4f98185f - std::io::Write::write_fmt::h0aebada01ce9c9e1
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/io/mod.rs:1832:15
   7:     0x7f6f4f98caae - std::sys_common::backtrace::_print::hb8b452cedd5245b9
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f6f4f98caae - std::sys_common::backtrace::print::h45e09369dba6d79a
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f6f4f98f429 - std::panicking::default_hook::{{closure}}::h17bec0ff62b1df32
  10:     0x7f6f4f98f16d - std::panicking::default_hook::hc8938c3997234b0d
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/panicking.rs:291:9
  11:     0x7f6f52a6d3dc - std[531770c5e2e8d301]::panicking::update_hook::<alloc[d882034972180c03]::boxed::Box<rustc_driver_impl[427e5c398467f86b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f6f4f98fb2c - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6d2f4133a0440d99
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/alloc/src/boxed.rs:2032:9
  13:     0x7f6f4f98fb2c - std::panicking::rust_panic_with_hook::h7c86743fcac7c36d
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/panicking.rs:792:13
  14:     0x7f6f52a9cf54 - std[531770c5e2e8d301]::panicking::begin_panic::<rustc_errors[1b3eec32e47ffd2f]::ExplicitBug>::{closure#0}
  15:     0x7f6f52a99bd6 - std[531770c5e2e8d301]::sys_common::backtrace::__rust_end_short_backtrace::<std[531770c5e2e8d301]::panicking::begin_panic<rustc_errors[1b3eec32e47ffd2f]::ExplicitBug>::{closure#0}, !>
  16:     0x7f6f52a998b6 - std[531770c5e2e8d301]::panicking::begin_panic::<rustc_errors[1b3eec32e47ffd2f]::ExplicitBug>
  17:     0x7f6f52aa5f81 - <rustc_errors[1b3eec32e47ffd2f]::diagnostic::BugAbort as rustc_errors[1b3eec32e47ffd2f]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f6f52ce55b8 - <rustc_errors[1b3eec32e47ffd2f]::DiagCtxt>::span_bug::<rustc_span[53b55791d064607f]::span_encoding::Span, alloc[d882034972180c03]::string::String>
  19:     0x7f6f52d1c5fd - rustc_middle[d8712503438341b1]::util::bug::opt_span_bug_fmt::<rustc_span[53b55791d064607f]::span_encoding::Span>::{closure#0}
  20:     0x7f6f52d1c92a - rustc_middle[d8712503438341b1]::ty::context::tls::with_opt::<rustc_middle[d8712503438341b1]::util::bug::opt_span_bug_fmt<rustc_span[53b55791d064607f]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f6f52d0199b - rustc_middle[d8712503438341b1]::ty::context::tls::with_context_opt::<rustc_middle[d8712503438341b1]::ty::context::tls::with_opt<rustc_middle[d8712503438341b1]::util::bug::opt_span_bug_fmt<rustc_span[53b55791d064607f]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f6f52d006b7 - rustc_middle[d8712503438341b1]::util::bug::span_bug_fmt::<rustc_span[53b55791d064607f]::span_encoding::Span>
  23:     0x7f6f50a07ce1 - <rustc_trait_selection[27d743aeac5b0616]::traits::fulfill::FulfillProcessor as rustc_data_structures[f4bfcbb9d91a10eb]::obligation_forest::ObligationProcessor>::process_obligation
  24:     0x7f6f53e0d823 - <rustc_data_structures[f4bfcbb9d91a10eb]::obligation_forest::ObligationForest<rustc_trait_selection[27d743aeac5b0616]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[27d743aeac5b0616]::traits::fulfill::FulfillProcessor>
  25:     0x7f6f54ee0b00 - <rustc_hir_typeck[77e1cc157524533d]::fn_ctxt::FnCtxt>::check_method_argument_types
  26:     0x7f6f5477384a - <rustc_hir_typeck[77e1cc157524533d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7f6f54773732 - <rustc_hir_typeck[77e1cc157524533d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7f6f5476d6e1 - <rustc_hir_typeck[77e1cc157524533d]::fn_ctxt::FnCtxt>::check_block_with_expected
  29:     0x7f6f54773701 - <rustc_hir_typeck[77e1cc157524533d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7f6f54054821 - rustc_hir_typeck[77e1cc157524533d]::check::check_fn
  31:     0x7f6f5404ad49 - rustc_hir_typeck[77e1cc157524533d]::typeck
  32:     0x7f6f5404a709 - rustc_query_impl[ffef2ea0cc82d0dd]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ffef2ea0cc82d0dd]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d8712503438341b1]::query::erase::Erased<[u8; 8usize]>>
  33:     0x7f6f54036d31 - rustc_query_system[219200ddf699f4fc]::query::plumbing::try_execute_query::<rustc_query_impl[ffef2ea0cc82d0dd]::DynamicConfig<rustc_query_system[219200ddf699f4fc]::query::caches::VecCache<rustc_span[53b55791d064607f]::def_id::LocalDefId, rustc_middle[d8712503438341b1]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ffef2ea0cc82d0dd]::plumbing::QueryCtxt, false>
  34:     0x7f6f5403564c - rustc_query_impl[ffef2ea0cc82d0dd]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7f6f54035218 - <rustc_middle[d8712503438341b1]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[6a1b22ded269dcc8]::check_crate::{closure#4}>::{closure#0}
  36:     0x7f6f54033f01 - rustc_hir_analysis[6a1b22ded269dcc8]::check_crate
  37:     0x7f6f546c5b7a - rustc_interface[336e9a5fb47021d9]::passes::analysis
  38:     0x7f6f546c56d5 - rustc_query_impl[ffef2ea0cc82d0dd]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ffef2ea0cc82d0dd]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d8712503438341b1]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7f6f54c4c9a5 - rustc_query_system[219200ddf699f4fc]::query::plumbing::try_execute_query::<rustc_query_impl[ffef2ea0cc82d0dd]::DynamicConfig<rustc_query_system[219200ddf699f4fc]::query::caches::SingleCache<rustc_middle[d8712503438341b1]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ffef2ea0cc82d0dd]::plumbing::QueryCtxt, false>
  40:     0x7f6f54c4c709 - rustc_query_impl[ffef2ea0cc82d0dd]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7f6f54abdfd9 - rustc_interface[336e9a5fb47021d9]::interface::run_compiler::<core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>, rustc_driver_impl[427e5c398467f86b]::run_compiler::{closure#0}>::{closure#1}
  42:     0x7f6f549ab327 - std[531770c5e2e8d301]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[336e9a5fb47021d9]::util::run_in_thread_with_globals<rustc_interface[336e9a5fb47021d9]::util::run_in_thread_pool_with_globals<rustc_interface[336e9a5fb47021d9]::interface::run_compiler<core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>, rustc_driver_impl[427e5c398467f86b]::run_compiler::{closure#0}>::{closure#1}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>::{closure#0}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>
  43:     0x7f6f549ab0ea - <<std[531770c5e2e8d301]::thread::Builder>::spawn_unchecked_<rustc_interface[336e9a5fb47021d9]::util::run_in_thread_with_globals<rustc_interface[336e9a5fb47021d9]::util::run_in_thread_pool_with_globals<rustc_interface[336e9a5fb47021d9]::interface::run_compiler<core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>, rustc_driver_impl[427e5c398467f86b]::run_compiler::{closure#0}>::{closure#1}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>::{closure#0}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2a3c68b720306447]::result::Result<(), rustc_span[53b55791d064607f]::ErrorGuaranteed>>::{closure#2} as core[2a3c68b720306447]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  44:     0x7f6f4f999a1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc8d25b9018534ef3
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/alloc/src/boxed.rs:2018:9
  45:     0x7f6f4f999a1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9f7c65c9881af958
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/alloc/src/boxed.rs:2018:9
  46:     0x7f6f4f999a1b - std::sys::pal::unix::thread::Thread::new::thread_start::ha61a9957d3d99efc
                               at /rustc/1cec373f65eb76e8e4b4d1847213cf3ec6c292b6/library/std/src/sys/pal/unix/thread.rs:108:17
  47:     0x7f6f4f740ac3 - <unknown>
  48:     0x7f6f4f7d2850 - <unknown>
  49:                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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/rustc-ice-2024-04-17T15_05_16-30577.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

query stack during panic:
#0 [typeck] type-checking `builder::<impl at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/src/builder.rs:78:1: 78:13>::init`
#1 [analysis] running analysis passes on this crate
end of query stack
Backtrace

error: internal compiler error: compiler/rustc_infer/src/infer/mod.rs:956:17: opaque types got hidden types registered from within subtype predicate: tracing_subscriber::layer::Layered<Alias(Opaque, AliasTy { args: [tracing_subscriber::Registry], def_id: DefId(0:1540 ~ console_subscriber[d8e0]::builder::{impl#1}::spawn::{opaque#0}) }), tracing_subscriber::Registry, tracing_subscriber::Registry> vs tracing_subscriber::layer::Layered<Alias(Opaque, AliasTy { args: [tracing_subscriber::Registry], def_id: DefId(0:1540 ~ console_subscriber[d8e0]::builder::{impl#1}::spawn::{opaque#0}) }), tracing_subscriber::Registry, tracing_subscriber::Registry>
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/src/builder.rs:407:19
    |
407 |             .with(tracing_subscriber::fmt::layer().with_filter(fmt_filter))
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_infer/src/infer/mod.rs:956:17:
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_errors::DiagCtxt>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: 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::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}, !>
   6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   7: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
   8: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
   9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_method_argument_types
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  14: rustc_hir_typeck::check::check_fn
  15: rustc_hir_typeck::typeck
      [... omitted 1 frame ...]
  16: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}
  17: rustc_hir_analysis::check_crate
  18: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  19: 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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/rustc-ice-2024-04-17T15_06_33-30880.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

query stack during panic:
#0 [typeck] type-checking `builder::<impl at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.2.0/src/builder.rs:78:1: 78:13>::init`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `console-subscriber` (lib)

@ChrisGreenaway ChrisGreenaway 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 Apr 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 17, 2024
@ChrisGreenaway
Copy link
Author

Duplicate of #124079

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 17, 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

3 participants