Skip to content

Could not compile serde_traitobject #113148

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
Jatin-Nagpal opened this issue Jun 29, 2023 · 3 comments
Closed

Could not compile serde_traitobject #113148

Jatin-Nagpal opened this issue Jun 29, 2023 · 3 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Jatin-Nagpal
Copy link

Code

<code>

Meta

rustc --version --verbose:

rustc 1.68.0 (2c8cc3432 2023-03-06)
binary: rustc
commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74
commit-date: 2023-03-06
host: x86_64-unknown-linux-gnu
release: 1.68.0
LLVM version: 15.0.6

Command

RUST_BACKTRACE=full RUSTFLAGS=-Ctarget-cpu=native cargo +nightly bench

Error output

Compiling serde_traitobject v0.2.8
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/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7f7e9d15fb71 - trace
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f7e9d15fb71 - trace_unsynchronized<std::sys_common::backtrace::_print_fmt::{closure_env#1}>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7e9d15fb71 - _print_fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f7e9d15fb71 - fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f7e9d1c04bf - fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/fmt/rt.rs:138:9
   5:     0x7f7e9d1c04bf - write
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f7e9d152d71 - write_fmt<std::sys::unix::stdio::Stderr>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/io/mod.rs:1713:15
   7:     0x7f7e9d15f985 - _print
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f7e9d15f985 - print
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f7e9d162647 - {closure#1}
  10:     0x7f7e9d162434 - default_hook
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:288:9
  11:     0x7f7e9bfcc9fb - <rustc_driver_impl[3f359aa20f2c61f0]::install_ice_hook::{closure#0} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(&core[f9f5fd1b7386ffed]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f7e9d162d8d - call<(&core::panic::panic_info::PanicInfo), (dyn core::ops::function::Fn<(&core::panic::panic_info::PanicInfo), Output=()> + core::marker::Send + core::marker::Sync), alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1999:9
  13:     0x7f7e9d162d8d - rust_panic_with_hook
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:709:13
  14:     0x7f7e9c4e30b1 - std[72a9bdb14847565]::panicking::begin_panic::<rustc_errors[ff27f3bf056b22eb]::ExplicitBug>::{closure#0}
  15:     0x7f7e9c4de8c6 - std[72a9bdb14847565]::sys_common::backtrace::__rust_end_short_backtrace::<std[72a9bdb14847565]::panicking::begin_panic<rustc_errors[ff27f3bf056b22eb]::ExplicitBug>::{closure#0}, !>
  16:     0x7f7e9c558e56 - std[72a9bdb14847565]::panicking::begin_panic::<rustc_errors[ff27f3bf056b22eb]::ExplicitBug>
  17:     0x7f7e9c4d8b34 - <rustc_errors[ff27f3bf056b22eb]::HandlerInner>::bug::<alloc[c49a19475105f89d]::string::String>
  18:     0x7f7e9c4d88d6 - <rustc_errors[ff27f3bf056b22eb]::Handler>::bug::<alloc[c49a19475105f89d]::string::String>
  19:     0x7f7e9c567265 - rustc_middle[d11dae94dae5aa4]::util::bug::opt_span_bug_fmt::<rustc_span[75d82fe363844395]::span_encoding::Span>::{closure#0}
  20:     0x7f7e9c563e8a - rustc_middle[d11dae94dae5aa4]::ty::context::tls::with_opt::<rustc_middle[d11dae94dae5aa4]::util::bug::opt_span_bug_fmt<rustc_span[75d82fe363844395]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f7e9c563e5a - rustc_middle[d11dae94dae5aa4]::ty::context::tls::with_context_opt::<rustc_middle[d11dae94dae5aa4]::ty::context::tls::with_opt<rustc_middle[d11dae94dae5aa4]::util::bug::opt_span_bug_fmt<rustc_span[75d82fe363844395]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f7e9a26383d - rustc_middle[d11dae94dae5aa4]::util::bug::bug_fmt
  23:     0x7f7e9ad60746 - <rustc_mir_transform[4856baf7e44d39b8]::inline::Inliner>::try_inlining
  24:     0x7f7e9ad583f1 - <rustc_mir_transform[4856baf7e44d39b8]::inline::Inliner>::process_blocks
  25:     0x7f7e9ad57bd8 - <rustc_mir_transform[4856baf7e44d39b8]::inline::Inline as rustc_middle[d11dae94dae5aa4]::mir::MirPass>::run_pass
  26:     0x7f7e9b37845e - rustc_mir_transform[4856baf7e44d39b8]::optimized_mir
  27:     0x7f7e9a0662c8 - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>
  28:     0x7f7e9a066291 - <rustc_query_impl[84f706b35b6b9e70]::query_impl::optimized_mir::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, rustc_span[75d82fe363844395]::def_id::DefId)>>::call_once
  29:     0x7f7e9a023c35 - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::DefaultCache<rustc_span[75d82fe363844395]::def_id::DefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  30:     0x7f7e9b949574 - rustc_query_impl[84f706b35b6b9e70]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7f7e9b3210fd - <rustc_metadata[f0361a87505a3bd1]::rmeta::encoder::EncodeContext>::encode_crate_root
  32:     0x7f7e9b2ab3eb - rustc_metadata[f0361a87505a3bd1]::rmeta::encoder::encode_metadata_impl
  33:     0x7f7e9b2a3db1 - rustc_data_structures[1f97a7aa4fc669e3]::sync::join::<rustc_metadata[f0361a87505a3bd1]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[f0361a87505a3bd1]::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
  34:     0x7f7e9b2a39b9 - rustc_metadata[f0361a87505a3bd1]::rmeta::encoder::encode_metadata
  35:     0x7f7e9b2a22cb - rustc_metadata[f0361a87505a3bd1]::fs::encode_and_write_metadata
  36:     0x7f7e9b295830 - rustc_interface[5cebeb4b37f8e7df]::passes::start_codegen
  37:     0x7f7e9b29100d - <rustc_middle[d11dae94dae5aa4]::ty::context::GlobalCtxt>::enter::<<rustc_interface[5cebeb4b37f8e7df]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<alloc[c49a19475105f89d]::boxed::Box<dyn core[f9f5fd1b7386ffed]::any::Any>, rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  38:     0x7f7e9b28f75d - <rustc_interface[5cebeb4b37f8e7df]::queries::Queries>::ongoing_codegen
  39:     0x7f7e9b28ed33 - <rustc_interface[5cebeb4b37f8e7df]::interface::Compiler>::enter::<rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}::{closure#2}, core[f9f5fd1b7386ffed]::result::Result<core[f9f5fd1b7386ffed]::option::Option<rustc_interface[5cebeb4b37f8e7df]::queries::Linker>, rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  40:     0x7f7e9b28c310 - std[72a9bdb14847565]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5cebeb4b37f8e7df]::util::run_in_thread_pool_with_globals<rustc_interface[5cebeb4b37f8e7df]::interface::run_compiler<core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>, rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}>::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  41:     0x7f7e9b28bab5 - <<std[72a9bdb14847565]::thread::Builder>::spawn_unchecked_<rustc_interface[5cebeb4b37f8e7df]::util::run_in_thread_pool_with_globals<rustc_interface[5cebeb4b37f8e7df]::interface::run_compiler<core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>, rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}>::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#1} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7f7e9d16d2b5 - call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1985:9
  43:     0x7f7e9d16d2b5 - call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1985:9
  44:     0x7f7e9d16d2b5 - thread_start
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7f7e98a94b43 - start_thread
                               at ./nptl/pthread_create.c:442:8
  46:     0x7f7e98b26a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  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 (a97c36dd2 2023-06-07) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `convenience::<impl at /home/jatin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_traitobject-0.2.8/src/convenience.rs:159:1: 159:51>::call_mut`
end of query stack
error: could not compile `serde_traitobject` (lib)
Backtrace

<backtrace>

@Jatin-Nagpal Jatin-Nagpal 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 29, 2023
@lqd
Copy link
Member

lqd commented Jun 29, 2023

So that we can reproduce the issue, could you also link to the code you are encountering the ICE on ?

  • https://github.com/alecmocatta/serde_traitobject has no benchmarks
  • serde_traitobject builds for me on the most recent nightly, rustc 1.72.0-nightly (5bd28f5ea 2023-06-28), and its tests also pass
  • the rustc 1.68.0 (2c8cc3432 2023-03-06) you mention is stable 1.68.0, while you're testing with nightly: which nightly version are you using ?

Thanks in advance!

Otherwise this issue could be related to #110829 (or the same issue) and which should be fixed by #110833 (and rustup-toolchain-install-master of 28bd1d3010201044fa44005fae674a82a8868cbf should be able to build serde_traitobject for you, if that's indeed the case)

(serde_traitobject requires nightly -- it transitively depends on crates requiring specialization and other unstable features -- so I'll also add that label.)

@lqd lqd added the requires-nightly This issue requires a nightly compiler in some way. label Jun 29, 2023
@jyn514 jyn514 added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Jun 30, 2023
@Jatin-Nagpal
Copy link
Author

Current hack, which I've used for fixing it is run cargo bench with 1.70.0-nightly version. Thanks

@xiaoyawei
Copy link

So that we can reproduce the issue, could you also link to the code you are encountering the ICE on ?

  • https://github.com/alecmocatta/serde_traitobject has no benchmarks
  • serde_traitobject builds for me on the most recent nightly, rustc 1.72.0-nightly (5bd28f5ea 2023-06-28), and its tests also pass
  • the rustc 1.68.0 (2c8cc3432 2023-03-06) you mention is stable 1.68.0, while you're testing with nightly: which nightly version are you using ?

Thanks in advance!

Otherwise this issue could be related to #110829 (or the same issue) and which should be fixed by #110833 (and rustup-toolchain-install-master of 28bd1d3010201044fa44005fae674a82a8868cbf should be able to build serde_traitobject for you, if that's indeed the case)

(serde_traitobject requires nightly -- it transitively depends on crates requiring specialization and other unstable features -- so I'll also add that label.)

I opened a new issue as a reply to this comment at #114361. In short, building serde_traitobject with --release flag shall help reproduce the bug

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. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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

4 participants