Skip to content

cannot compile serde_traitobject #114361

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
xiaoyawei opened this issue Aug 2, 2023 · 2 comments
Closed

cannot compile serde_traitobject #114361

xiaoyawei opened this issue Aug 2, 2023 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@xiaoyawei
Copy link

xiaoyawei commented Aug 2, 2023

I tried this code:

Pull the code from master branch of https://github.com/alecmocatta/serde_traitobject

none

I expected to see this happen: code compiles

Instead, this happened: compilation fails

Meta

rustc --version --verbose:

<version>
rustc 1.72.0-nightly (5bd28f5ea 2023-06-28)
binary: rustc
commit-hash: 5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0
commit-date: 2023-06-28
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Command

cargo build --release

Details

This is actually a follow-up issue of #113148, especially a response to the comment #113148 (comment) by @lqd

Actually, if I build https://github.com/alecmocatta/serde_traitobject with --release flag, then the same bug can be reproduced as from the issue #113148

Backtrace

<backtrace>
error: internal compiler error: compiler/rustc_mir_transform/src/inline.rs:220:17: Closure arguments are not passed as a tuple

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7fbb0015be31 - std::backtrace_rs::backtrace::libunwind::trace::h8bc3e596fd6e6181
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fbb0015be31 - std::backtrace_rs::backtrace::trace_unsynchronized::h9a0656fedca2f962
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fbb0015be31 - std::sys_common::backtrace::_print_fmt::h11ca79bc953fda0e
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fbb0015be31 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h23585af82c540d61
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fbb001bd5df - core::fmt::rt::Argument::fmt::h1e7f4bcecbee3fbb
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/core/src/fmt/rt.rs:138:9
   5:     0x7fbb001bd5df - core::fmt::write::h41633f265152b738
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fbb0014e967 - std::io::Write::write_fmt::hdf9fdeebf4391d4c
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/io/mod.rs:1714:15
   7:     0x7fbb0015bc45 - std::sys_common::backtrace::_print::h0761f433dadea582
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fbb0015bc45 - std::sys_common::backtrace::print::hffcd468cc9baf957
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fbb0015e9f3 - std::panicking::default_hook::{{closure}}::h70eb212f41458c90
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:269:22
  10:     0x7fbb0015e784 - std::panicking::default_hook::hf217f8886a1385fc
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:288:9
  11:     0x7fbb0341617b - <rustc_driver_impl[ea51492c730803db]::install_ice_hook::{closure#0} as core[6e72eb595340d7ba]::ops::function::FnOnce<(&core[6e72eb595340d7ba]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7fbb0015f21e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hdf84d12f536c7065
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2024:9
  13:     0x7fbb0015f21e - std::panicking::rust_panic_with_hook::h7901b0073bb3ed74
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:709:13
  14:     0x7fbb038ead91 - std[4a840e81aae3439]::panicking::begin_panic::<rustc_errors[74566eb9727f9d9c]::ExplicitBug>::{closure#0}
  15:     0x7fbb038e9106 - std[4a840e81aae3439]::sys_common::backtrace::__rust_end_short_backtrace::<std[4a840e81aae3439]::panicking::begin_panic<rustc_errors[74566eb9727f9d9c]::ExplicitBug>::{closure#0}, !>
  16:     0x7fbb038e8626 - std[4a840e81aae3439]::panicking::begin_panic::<rustc_errors[74566eb9727f9d9c]::ExplicitBug>
  17:     0x7fbb0395ee94 - <rustc_errors[74566eb9727f9d9c]::HandlerInner>::bug::<alloc[6fd48550c51b5745]::string::String>
  18:     0x7fbb0395ed16 - <rustc_errors[74566eb9727f9d9c]::Handler>::bug::<alloc[6fd48550c51b5745]::string::String>
  19:     0x7fbb038e604c - rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt::<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}
  20:     0x7fbb038e5f8a - rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_opt::<rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fbb038e5f5a - rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_context_opt::<rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_opt<rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fbb01880c4d - rustc_middle[9f74ec5cb00a905a]::util::bug::bug_fmt
  23:     0x7fbb02236012 - <rustc_mir_transform[3a72d7fd4a713ad]::inline::Inliner>::try_inlining
  24:     0x7fbb0222f005 - <rustc_mir_transform[3a72d7fd4a713ad]::inline::Inliner>::process_blocks
  25:     0x7fbb0222e80a - <rustc_mir_transform[3a72d7fd4a713ad]::inline::Inline as rustc_middle[9f74ec5cb00a905a]::mir::MirPass>::run_pass
  26:     0x7fbb027e7c9f - rustc_mir_transform[3a72d7fd4a713ad]::optimized_mir
  27:     0x7fbb01483b70 - rustc_query_impl[a5bf74a69bd3660]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a5bf74a69bd3660]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9f74ec5cb00a905a]::query::erase::Erased<[u8; 8usize]>>
  28:     0x7fbb01483b31 - <rustc_query_impl[a5bf74a69bd3660]::query_impl::optimized_mir::dynamic_query::{closure#2} as core[6e72eb595340d7ba]::ops::function::FnOnce<(rustc_middle[9f74ec5cb00a905a]::ty::context::TyCtxt, rustc_span[624dabdd61f2978b]::def_id::DefId)>>::call_once
  29:     0x7fbb01444015 - rustc_query_system[d65e888f3fe19f8d]::query::plumbing::try_execute_query::<rustc_query_impl[a5bf74a69bd3660]::DynamicConfig<rustc_query_system[d65e888f3fe19f8d]::query::caches::DefaultCache<rustc_span[624dabdd61f2978b]::def_id::DefId, rustc_middle[9f74ec5cb00a905a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a5bf74a69bd3660]::plumbing::QueryCtxt, false>
  30:     0x7fbb02d8a904 - rustc_query_impl[a5bf74a69bd3660]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7fbb02741390 - <rustc_metadata[8c11abb6123f9fbb]::rmeta::encoder::EncodeContext>::encode_crate_root
  32:     0x7fbb026cdd57 - rustc_metadata[8c11abb6123f9fbb]::rmeta::encoder::encode_metadata_impl
  33:     0x7fbb026c3f76 - rustc_metadata[8c11abb6123f9fbb]::rmeta::encoder::encode_metadata
  34:     0x7fbb026c24a9 - rustc_metadata[8c11abb6123f9fbb]::fs::encode_and_write_metadata
  35:     0x7fbb026b3d80 - rustc_interface[b943f00ad50b5541]::passes::start_codegen
  36:     0x7fbb026adf2a - <rustc_middle[9f74ec5cb00a905a]::ty::context::GlobalCtxt>::enter::<<rustc_interface[b943f00ad50b5541]::queries::Queries>::ongoing_codegen::{closure#0}, core[6e72eb595340d7ba]::result::Result<alloc[6fd48550c51b5745]::boxed::Box<dyn core[6e72eb595340d7ba]::any::Any>, rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
  37:     0x7fbb026ad3a2 - <rustc_interface[b943f00ad50b5541]::interface::Compiler>::enter::<rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}::{closure#2}, core[6e72eb595340d7ba]::result::Result<core[6e72eb595340d7ba]::option::Option<rustc_interface[b943f00ad50b5541]::queries::Linker>, rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
  38:     0x7fbb026a8575 - rustc_span[624dabdd61f2978b]::set_source_map::<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  39:     0x7fbb026a7996 - <scoped_tls[8088cff701f74b4a]::ScopedKey<rustc_span[624dabdd61f2978b]::SessionGlobals>>::set::<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
  40:     0x7fbb026a6f46 - std[4a840e81aae3439]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b943f00ad50b5541]::util::run_in_thread_pool_with_globals<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
  41:     0x7fbb026a6cee - <<std[4a840e81aae3439]::thread::Builder>::spawn_unchecked_<rustc_interface[b943f00ad50b5541]::util::run_in_thread_pool_with_globals<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#1} as core[6e72eb595340d7ba]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7fbb00169695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h61eb867555625a06
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2010:9
  43:     0x7fbb00169695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb80c29f89b136b72
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2010:9
  44:     0x7fbb00169695 - std::sys::unix::thread::Thread::new::thread_start::hf4205715d65b27a6
                               at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7fbb0002e609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  46:     0x7fbafff51133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  47:                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.72.0-nightly (5bd28f5ea 2023-06-28) 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 [optimized_mir] optimizing MIR for `convenience::<impl at src/convenience.rs:159:1: 159:51>::call_mut`
end of query stack
error: could not compile `serde_traitobject` (lib)
warning: build failed, waiting for other jobs to finish...

@xiaoyawei xiaoyawei added the C-bug Category: This is a bug. label Aug 2, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 2, 2023
@xiaoyawei
Copy link
Author

Just tried building it with rustc of a more recent version but the same issue still exists.

rustc 1.73.0-nightly (d12c6e947 2023-08-01)
binary: rustc
commit-hash: d12c6e947ceacf3b22c154caf9532b390d8dc88a
commit-date: 2023-08-01
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

@lqd
Copy link
Member

lqd commented Aug 2, 2023

Thanks for providing the steps to reproduce missing from the previous issue.

So this is definitely a duplicate of #110829 so I'll close it as such, but this issue will be fixed by #110833 and should land soon (it almost did 2 days ago, it only needs a few tests updated).

If you want, you can try it today with rustup-toolchain-install-master of 28bd1d3010201044fa44005fae674a82a8868cbf and building with that +28d... toolchain. I've tested that serde_traitobject builds in release mode with that rustc try build.

Feel free to reopen if it somehow persists after that PR has landed. Thanks for opening the issue!

@lqd lqd closed this as completed Aug 2, 2023
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 3, 2023
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.
Projects
None yet
Development

No branches or pull requests

4 participants