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

Error at async function with enum matching #117975

Closed
TTTiNNNy opened this issue Nov 16, 2023 · 3 comments
Closed

Error at async function with enum matching #117975

TTTiNNNy opened this issue Nov 16, 2023 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@TTTiNNNy
Copy link

Code

enum En1 {
    Var1(()),
}

async fn func(en: En1) {
    match en {
        En1::Var1(val) => match val {},
    }
}

Meta

Build using the Beta version: 1.75.0-beta.1

(2023-11-12 782883f609713fe9617b)

Error output

error: internal compiler error: compiler/rustc_mir_transform/src/coroutine.rs:1463:14: unexpected coroutine type Pin<&mut {async fn body@src/main.rs:83:39: 87:2}>
  --> src/main.rs:83:39
   |
83 |   async fn transaction(operations: En1) {
   |  _______________________________________^
84 | |     match operations {
85 | |         En1::Var1(val) => match val {},
86 | |     }
87 | | }
   | |_^

thread 'rustc' panicked at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/compiler/rustc_errors/src/lib.rs:999:33:
Box<dyn Any>
Backtrace

stack backtrace:
   0:     0x7f04ddc2589c - std::backtrace_rs::backtrace::libunwind::trace::ha293b6d87ccf1f1c
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f04ddc2589c - std::backtrace_rs::backtrace::trace_unsynchronized::h490dbd5f01054bca
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f04ddc2589c - std::sys_common::backtrace::_print_fmt::hb9cac74d01a13d4b
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f04ddc2589c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcf57bf5852a8c416
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f04ddc788a0 - core::fmt::rt::Argument::fmt::h5de7bc4768ddf33e
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/core/src/fmt/rt.rs:142:9
   5:     0x7f04ddc788a0 - core::fmt::write::hbbbf6d556f1ac8b9
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f04ddc1972f - std::io::Write::write_fmt::h1b479e1ec81bc956
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/io/mod.rs:1762:15
   7:     0x7f04ddc25684 - std::sys_common::backtrace::_print::hd9cfabd7d6a771d4
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f04ddc25684 - std::sys_common::backtrace::print::h07393481cb263284
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f04ddc28317 - std::panicking::default_hook::{{closure}}::hb1598819f87c42e5
  10:     0x7f04ddc2807f - std::panicking::default_hook::h7f873e973269c845
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/panicking.rs:292:9
  11:     0x7f04da8ea570 - std[14019a58b7d275f1]::panicking::update_hook::<alloc[ad6fb59b907768cd]::boxed::Box<rustc_driver_impl[5f75542baa940ca0]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f04ddc28a58 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h704679cae2ba6984
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/alloc/src/boxed.rs:2021:9
  13:     0x7f04ddc28a58 - std::panicking::rust_panic_with_hook::he9c5618dc5aecbda
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/panicking.rs:783:13
  14:     0x7f04daf08f14 - std[14019a58b7d275f1]::panicking::begin_panic::<rustc_errors[30021261b551d970]::ExplicitBug>::{closure#0}
  15:     0x7f04daeee006 - std[14019a58b7d275f1]::sys_common::backtrace::__rust_end_short_backtrace::<std[14019a58b7d275f1]::panicking::begin_panic<rustc_errors[30021261b551d970]::ExplicitBug>::{closure#0}, !>
  16:     0x7f04daee8be6 - std[14019a58b7d275f1]::panicking::begin_panic::<rustc_errors[30021261b551d970]::ExplicitBug>
  17:     0x7f04daedfe4e - <rustc_errors[30021261b551d970]::HandlerInner>::span_bug::<rustc_span[a628673111809004]::span_encoding::Span, alloc[ad6fb59b907768cd]::string::String>
  18:     0x7f04daed4a58 - <rustc_errors[30021261b551d970]::Handler>::span_bug::<rustc_span[a628673111809004]::span_encoding::Span, alloc[ad6fb59b907768cd]::string::String>
  19:     0x7f04daf0905b - rustc_middle[152bbcda416848dc]::util::bug::opt_span_bug_fmt::<rustc_span[a628673111809004]::span_encoding::Span>::{closure#0}
  20:     0x7f04daf0908a - rustc_middle[152bbcda416848dc]::ty::context::tls::with_opt::<rustc_middle[152bbcda416848dc]::util::bug::opt_span_bug_fmt<rustc_span[a628673111809004]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f04daefeb78 - rustc_middle[152bbcda416848dc]::ty::context::tls::with_context_opt::<rustc_middle[152bbcda416848dc]::ty::context::tls::with_opt<rustc_middle[152bbcda416848dc]::util::bug::opt_span_bug_fmt<rustc_span[a628673111809004]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f04d982bc34 - rustc_middle[152bbcda416848dc]::util::bug::span_bug_fmt::<rustc_span[a628673111809004]::span_encoding::Span>
  23:     0x7f04daf9b2f2 - rustc_mir_transform[c7b2aa5ff33101ec]::coroutine::mir_coroutine_witnesses
  24:     0x7f04db16467c - rustc_query_impl[b6f65b6a449d1433]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b6f65b6a449d1433]::query_impl::mir_coroutine_witnesses::dynamic_query::{closure#2}::{closure#0}, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7f04dbfa75e8 - rustc_query_system[b64554a9092e067b]::query::plumbing::try_execute_query::<rustc_query_impl[b6f65b6a449d1433]::DynamicConfig<rustc_query_system[b64554a9092e067b]::query::caches::DefaultCache<rustc_span[a628673111809004]::def_id::DefId, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b6f65b6a449d1433]::plumbing::QueryCtxt, true>
  26:     0x7f04db16a65d - rustc_query_impl[b6f65b6a449d1433]::query_impl::mir_coroutine_witnesses::get_query_incr::__rust_end_short_backtrace
  27:     0x7f04dbda1ed8 - rustc_middle[152bbcda416848dc]::query::plumbing::query_get_at::<rustc_query_system[b64554a9092e067b]::query::caches::DefaultCache<rustc_span[a628673111809004]::def_id::DefId, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 8usize]>>>
  28:     0x7f04dd1531fd - <rustc_middle[152bbcda416848dc]::ty::util::OpaqueTypeExpander as rustc_type_ir[333e1393af7593e5]::fold::TypeFolder<rustc_middle[152bbcda416848dc]::ty::context::TyCtxt>>::fold_ty.cold.0
  29:     0x7f04dc63049e - <&rustc_middle[152bbcda416848dc]::ty::list::List<rustc_middle[152bbcda416848dc]::ty::generic_args::GenericArg> as rustc_type_ir[333e1393af7593e5]::fold::TypeFoldable<rustc_middle[152bbcda416848dc]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[152bbcda416848dc]::ty::util::OpaqueTypeExpander>
  30:     0x7f04dd1533f3 - <rustc_middle[152bbcda416848dc]::ty::util::OpaqueTypeExpander as rustc_type_ir[333e1393af7593e5]::fold::TypeFolder<rustc_middle[152bbcda416848dc]::ty::context::TyCtxt>>::fold_ty.cold.0
  31:     0x7f04dc630c5f - <rustc_middle[152bbcda416848dc]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  32:     0x7f04dc630998 - <rustc_middle[152bbcda416848dc]::ty::context::TyCtxt>::try_expand_impl_trait_type
  33:     0x7f04dc36e36d - rustc_hir_analysis[b35314468770b41e]::check::check::check_mod_item_types
  34:     0x7f04dc36cd53 - rustc_query_impl[b6f65b6a449d1433]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b6f65b6a449d1433]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 0usize]>>
  35:     0x7f04dc57792b - rustc_query_system[b64554a9092e067b]::query::plumbing::try_execute_query::<rustc_query_impl[b6f65b6a449d1433]::DynamicConfig<rustc_query_system[b64554a9092e067b]::query::caches::DefaultCache<rustc_span[a628673111809004]::def_id::LocalModDefId, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b6f65b6a449d1433]::plumbing::QueryCtxt, true>
  36:     0x7f04dc577440 - rustc_query_impl[b6f65b6a449d1433]::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace
  37:     0x7f04dc215e15 - rustc_hir_analysis[b35314468770b41e]::check_crate
  38:     0x7f04dbf9a497 - rustc_interface[1968ba18ecfdcdc8]::passes::analysis
  39:     0x7f04dbf9a0dd - rustc_query_impl[b6f65b6a449d1433]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b6f65b6a449d1433]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 1usize]>>
  40:     0x7f04dcb96acb - rustc_query_system[b64554a9092e067b]::query::plumbing::try_execute_query::<rustc_query_impl[b6f65b6a449d1433]::DynamicConfig<rustc_query_system[b64554a9092e067b]::query::caches::SingleCache<rustc_middle[152bbcda416848dc]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b6f65b6a449d1433]::plumbing::QueryCtxt, true>
  41:     0x7f04dcb96774 - rustc_query_impl[b6f65b6a449d1433]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  42:     0x7f04dcbb0d3f - rustc_interface[1968ba18ecfdcdc8]::interface::run_compiler::<core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>, rustc_driver_impl[5f75542baa940ca0]::run_compiler::{closure#1}>::{closure#0}
  43:     0x7f04dcbb8059 - std[14019a58b7d275f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1968ba18ecfdcdc8]::util::run_in_thread_with_globals<rustc_interface[1968ba18ecfdcdc8]::util::run_in_thread_pool_with_globals<rustc_interface[1968ba18ecfdcdc8]::interface::run_compiler<core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>, rustc_driver_impl[5f75542baa940ca0]::run_compiler::{closure#1}>::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>
  44:     0x7f04dcbb7e83 - <<std[14019a58b7d275f1]::thread::Builder>::spawn_unchecked_<rustc_interface[1968ba18ecfdcdc8]::util::run_in_thread_with_globals<rustc_interface[1968ba18ecfdcdc8]::util::run_in_thread_pool_with_globals<rustc_interface[1968ba18ecfdcdc8]::interface::run_compiler<core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>, rustc_driver_impl[5f75542baa940ca0]::run_compiler::{closure#1}>::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a62a0f03b43184e2]::result::Result<(), rustc_span[a628673111809004]::ErrorGuaranteed>>::{closure#1} as core[a62a0f03b43184e2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  45:     0x7f04ddc32915 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h11dbcadb43be237a
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/alloc/src/boxed.rs:2007:9
  46:     0x7f04ddc32915 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h180b5548b3df9e0f
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/alloc/src/boxed.rs:2007:9
  47:     0x7f04ddc32915 - std::sys::unix::thread::Thread::new::thread_start::h76409cdbbbac597d
                               at /rustc/dd430bc8c22f57992ec1457a87437d14283fdd65/library/std/src/sys/unix/thread.rs:108:17
  48:     0x7f04d7aaa9eb - <unknown>
  49:     0x7f04d7b2e7cc - <unknown>
  50:                0x0 - <unknown>

@TTTiNNNy TTTiNNNy 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 Nov 16, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 16, 2023
@matthiaskrgr
Copy link
Member

Hmm, duplicate of #117670
But this is beta which might have just missed the fix :(

@matthiaskrgr
Copy link
Member

Ah the fix #117686 has already been nominated for beta, good.

@wesleywiser wesleywiser added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Nov 16, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 16, 2023
@matthiaskrgr matthiaskrgr removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 16, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 18, 2023
@Mark-Simulacrum
Copy link
Member

Looks like this is backported in #118492, so closing.

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) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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