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: "rust-call" ABI does not support unsized params #112608

Closed
matthiaskrgr opened this issue Jun 14, 2023 · 0 comments · Fixed by #112643
Closed

ICE: "rust-call" ABI does not support unsized params #112608

matthiaskrgr opened this issue Jun 14, 2023 · 0 comments · Fixed by #112643
Labels
C-bug Category: This is a bug. F-unsized_fn_params `#![feature(unsized_fn_params)]` 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

@matthiaskrgr
Copy link
Member

Code

While the original #67981 seem fixed, this modification seems to still crash.

#![feature(unsized_fn_params)]

fn main() {
    let f: fn([u8]) = |_result| {};
    
    let slice: Box<[u8]> = Box::new([1; 8]);
    
    f(*slice);
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (df77afbca 2023-06-12)
binary: rustc
commit-hash: df77afbcaf3365a32066a8ca4a00ae6fc9a69647
commit-date: 2023-06-12
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

<output>
Backtrace

error: internal compiler error: /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/compiler/rustc_codegen_ssa/src/mir/mod.rs:308:21: "rust-call" ABI does not support unsized params
   --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    |
250 |     extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/compiler/rustc_errors/src/lib.rs:994:33
stack backtrace:
   0:     0x7f4d5e768c41 - std::backtrace_rs::backtrace::libunwind::trace::hd830ec006d66d7bd
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f4d5e768c41 - std::backtrace_rs::backtrace::trace_unsynchronized::ha48a9544f0edee03
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f4d5e768c41 - std::sys_common::backtrace::_print_fmt::had4ddaa258f461e3
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f4d5e768c41 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he768f658e406b581
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f4d5e7c95ff - core::fmt::rt::Argument::fmt::h10ce9a0440e62ef5
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/core/src/fmt/rt.rs:138:9
   5:     0x7f4d5e7c95ff - core::fmt::write::h381a5b53ed990481
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f4d5e75be41 - std::io::Write::write_fmt::h6f7ffab47f774bac
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/io/mod.rs:1713:15
   7:     0x7f4d5e768a55 - std::sys_common::backtrace::_print::h6b3b514a9c0bb2a1
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f4d5e768a55 - std::sys_common::backtrace::print::h4d04f57fcaaadbf7
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f4d5e76b737 - std::panicking::default_hook::{{closure}}::h82f2d8896eabc353
  10:     0x7f4d5e76b524 - std::panicking::default_hook::h1d70e3392ff8715d
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/panicking.rs:288:9
  11:     0x7f4d619eb80b - rustc_driver_impl[bc9e93faacc37431]::install_ice_hook::{closure#0}
  12:     0x7f4d5e76be7d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hdeb68781aec8c01b
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/alloc/src/boxed.rs:1999:9
  13:     0x7f4d5e76be7d - std::panicking::rust_panic_with_hook::h411bd05f08be05b6
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/panicking.rs:709:13
  14:     0x7f4d6187f0e1 - std[74cc9e3c59aa80ae]::panicking::begin_panic::<rustc_errors[c5ec46bf3b0ea9c2]::ExplicitBug>::{closure#0}
  15:     0x7f4d6187d8a6 - std[74cc9e3c59aa80ae]::sys_common::backtrace::__rust_end_short_backtrace::<std[74cc9e3c59aa80ae]::panicking::begin_panic<rustc_errors[c5ec46bf3b0ea9c2]::ExplicitBug>::{closure#0}, !>
  16:     0x7f4d61831c66 - std[74cc9e3c59aa80ae]::panicking::begin_panic::<rustc_errors[c5ec46bf3b0ea9c2]::ExplicitBug>
  17:     0x7f4d61830222 - <rustc_errors[c5ec46bf3b0ea9c2]::HandlerInner>::span_bug::<rustc_span[bc106c13571faf85]::span_encoding::Span, alloc[87cbe4d25bb98c8e]::string::String>
  18:     0x7f4d6182ff06 - <rustc_errors[c5ec46bf3b0ea9c2]::Handler>::span_bug::<rustc_span[bc106c13571faf85]::span_encoding::Span, alloc[87cbe4d25bb98c8e]::string::String>
  19:     0x7f4d6187092d - rustc_middle[111bd832a8dd3e9b]::util::bug::opt_span_bug_fmt::<rustc_span[bc106c13571faf85]::span_encoding::Span>::{closure#0}
  20:     0x7f4d6187095a - rustc_middle[111bd832a8dd3e9b]::ty::context::tls::with_opt::<rustc_middle[111bd832a8dd3e9b]::util::bug::opt_span_bug_fmt<rustc_span[bc106c13571faf85]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f4d6187025a - rustc_middle[111bd832a8dd3e9b]::ty::context::tls::with_context_opt::<rustc_middle[111bd832a8dd3e9b]::ty::context::tls::with_opt<rustc_middle[111bd832a8dd3e9b]::util::bug::opt_span_bug_fmt<rustc_span[bc106c13571faf85]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f4d603615c4 - rustc_middle[111bd832a8dd3e9b]::util::bug::span_bug_fmt::<rustc_span[bc106c13571faf85]::span_encoding::Span>
  23:     0x7f4d60323cfb - <core[7eaf5f0da9577636]::iter::adapters::map::Map<core[7eaf5f0da9577636]::iter::adapters::enumerate::Enumerate<core[7eaf5f0da9577636]::iter::adapters::map::Map<core[7eaf5f0da9577636]::ops::range::Range<usize>, <rustc_middle[111bd832a8dd3e9b]::mir::Local as rustc_index[b646ff7bb36439aa]::idx::Idx>::new>>, rustc_codegen_ssa[ad8ce12ca4f75ed5]::mir::arg_local_refs<rustc_codegen_llvm[78f40839ab5d6bee]::builder::Builder>::{closure#0}> as core[7eaf5f0da9577636]::iter::traits::iterator::Iterator>::fold::<(), core[7eaf5f0da9577636]::iter::traits::iterator::Iterator::for_each::call<rustc_codegen_ssa[ad8ce12ca4f75ed5]::mir::LocalRef<&rustc_codegen_llvm[78f40839ab5d6bee]::llvm_::ffi::Value>, <alloc[87cbe4d25bb98c8e]::vec::Vec<rustc_codegen_ssa[ad8ce12ca4f75ed5]::mir::LocalRef<&rustc_codegen_llvm[78f40839ab5d6bee]::llvm_::ffi::Value>>>::extend_trusted<core[7eaf5f0da9577636]::iter::adapters::map::Map<core[7eaf5f0da9577636]::iter::adapters::enumerate::Enumerate<core[7eaf5f0da9577636]::iter::adapters::map::Map<core[7eaf5f0da9577636]::ops::range::Range<usize>, <rustc_middle[111bd832a8dd3e9b]::mir::Local as rustc_index[b646ff7bb36439aa]::idx::Idx>::new>>, rustc_codegen_ssa[ad8ce12ca4f75ed5]::mir::arg_local_refs<rustc_codegen_llvm[78f40839ab5d6bee]::builder::Builder>::{closure#0}>>::{closure#0}>::{closure#0}>
  24:     0x7f4d60339cc2 - rustc_codegen_ssa[ad8ce12ca4f75ed5]::mir::codegen_mir::<rustc_codegen_llvm[78f40839ab5d6bee]::builder::Builder>
  25:     0x7f4d60f5e832 - rustc_codegen_llvm[78f40839ab5d6bee]::base::compile_codegen_unit::module_codegen
  26:     0x7f4d60f5cff5 - rustc_codegen_llvm[78f40839ab5d6bee]::base::compile_codegen_unit
  27:     0x7f4d60ed06b7 - rustc_codegen_ssa[ad8ce12ca4f75ed5]::base::codegen_crate::<rustc_codegen_llvm[78f40839ab5d6bee]::LlvmCodegenBackend>
  28:     0x7f4d60ecff9f - <rustc_codegen_llvm[78f40839ab5d6bee]::LlvmCodegenBackend as rustc_codegen_ssa[ad8ce12ca4f75ed5]::traits::backend::CodegenBackend>::codegen_crate
  29:     0x7f4d60cb5a82 - <rustc_session[6c3c6789374dfdb7]::session::Session>::time::<alloc[87cbe4d25bb98c8e]::boxed::Box<dyn core[7eaf5f0da9577636]::any::Any>, rustc_interface[ec6df654b897cc82]::passes::start_codegen::{closure#0}>
  30:     0x7f4d60cb55cb - rustc_interface[ec6df654b897cc82]::passes::start_codegen
  31:     0x7f4d60cafcdd - <rustc_middle[111bd832a8dd3e9b]::ty::context::GlobalCtxt>::enter::<<rustc_interface[ec6df654b897cc82]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[7eaf5f0da9577636]::result::Result<alloc[87cbe4d25bb98c8e]::boxed::Box<dyn core[7eaf5f0da9577636]::any::Any>, rustc_span[bc106c13571faf85]::ErrorGuaranteed>>
  32:     0x7f4d60caf14d - <rustc_interface[ec6df654b897cc82]::queries::Queries>::ongoing_codegen
  33:     0x7f4d60cae723 - <rustc_interface[ec6df654b897cc82]::interface::Compiler>::enter::<rustc_driver_impl[bc9e93faacc37431]::run_compiler::{closure#1}::{closure#2}, core[7eaf5f0da9577636]::result::Result<core[7eaf5f0da9577636]::option::Option<rustc_interface[ec6df654b897cc82]::queries::Linker>, rustc_span[bc106c13571faf85]::ErrorGuaranteed>>
  34:     0x7f4d60cac289 - <scoped_tls[ada14302b38d1f15]::ScopedKey<rustc_span[bc106c13571faf85]::SessionGlobals>>::set::<rustc_interface[ec6df654b897cc82]::interface::run_compiler<core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>, rustc_driver_impl[bc9e93faacc37431]::run_compiler::{closure#1}>::{closure#0}, core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>>
  35:     0x7f4d60cab6f6 - std[74cc9e3c59aa80ae]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ec6df654b897cc82]::util::run_in_thread_pool_with_globals<rustc_interface[ec6df654b897cc82]::interface::run_compiler<core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>, rustc_driver_impl[bc9e93faacc37431]::run_compiler::{closure#1}>::{closure#0}, core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>>
  36:     0x7f4d60cab4a5 - <<std[74cc9e3c59aa80ae]::thread::Builder>::spawn_unchecked_<rustc_interface[ec6df654b897cc82]::util::run_in_thread_pool_with_globals<rustc_interface[ec6df654b897cc82]::interface::run_compiler<core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>, rustc_driver_impl[bc9e93faacc37431]::run_compiler::{closure#1}>::{closure#0}, core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7eaf5f0da9577636]::result::Result<(), rustc_span[bc106c13571faf85]::ErrorGuaranteed>>::{closure#1} as core[7eaf5f0da9577636]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f4d5e7763a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5622047e08c7cdf0
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/alloc/src/boxed.rs:1985:9
  38:     0x7f4d5e7763a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5e7463f2383057fb
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/alloc/src/boxed.rs:1985:9
  39:     0x7f4d5e7763a5 - std::sys::unix::thread::Thread::new::thread_start::h5c3763b970acc3be
                               at /rustc/df77afbcaf3365a32066a8ca4a00ae6fc9a69647/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7f4d5e50f44b - <unknown>
  41:     0x7f4d5e592e40 - <unknown>
  42:                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 (df77afbca 2023-06-12) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to previous error

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. F-unsized_fn_params `#![feature(unsized_fn_params)]` labels Jun 14, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
@bors bors closed this as completed in 27ae068 Jun 23, 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. F-unsized_fn_params `#![feature(unsized_fn_params)]` 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

Successfully merging a pull request may close this issue.

2 participants
@matthiaskrgr and others