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

Cbindgen fails on latest nightly (1.68.0-nightly) with an internal compiler error #105886

Closed
rholshausen opened this issue Dec 19, 2022 · 5 comments · Fixed by pact-foundation/pact-reference#270
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@rholshausen
Copy link

cbindgen internally runs cargo rustc -Zunpretty=expanded which is failing with an internal compiler error. You can see a failed build with the error at https://github.com/pact-foundation/pact-reference/actions/runs/3720065127/jobs/6320910722

Code

You can reproduce the error by running:

  • clone https://github.com/pact-foundation/pact-reference
  • cd rust/pact_ffi
  • rustup run nightly cbindgen --config cbindgen.toml --crate pact_ffi

Meta

Note, cbindgen requires to run with nightly rust.

rustc --version --verbose:

❯ rustup run nightly rustc --version --verbose
rustc 1.68.0-nightly (0468a00ae 2022-12-17)
binary: rustc
commit-hash: 0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc
commit-date: 2022-12-17
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

This has been extracted from the failing CI build:

error: internal compiler error: /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/compiler/rustc_mir_dataflow/src/elaborate_drops.rs:898:18: open drop from non-ADT `impl futures::Future<Output = ()>`
   --> pact_mock_server/src/mock_server.rs:157:66
    |
157 |       .map_err(|err| format!(\"Could not start server: {}\", err))?;
    |                                                                  ^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/compiler/rustc_errors/src/lib.rs:973:33
stack backtrace:
   0:     0x7ffaf101d85a - std::backtrace_rs::backtrace::libunwind::trace::h51cb40f2f8f23f31
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ffaf101d85a - std::backtrace_rs::backtrace::trace_unsynchronized::hebc3338ffed58a56
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffaf101d85a - std::sys_common::backtrace::_print_fmt::h136f982a4680ac7f
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ffaf101d85a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd1514baae6e42eb6\n                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ffaf108036e - core::fmt::write::hfbed4b54a5eebfee
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/core/src/fmt/mod.rs:1208:17
   5:     0x7ffaf100dbd5 - std::io::Write::write_fmt::h9f6098b6a54a9a94
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/io/mod.rs:1682:15
   6:     0x7ffaf101d625 - std::sys_common::backtrace::_print::h6e7a2bc7da6ecf73
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7ffaf101d625 - std::sys_common::backtrace::print::h631b25ef82a0eea1
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7ffaf102036f - std::panicking::default_hook::{{closure}}::h41299fc951b157c9
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:267:22
   9:     0x7ffaf10200ab - std::panicking::default_hook::hd317023abfdceaed
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:286:9
  10:     0x7ffaefe34cc1 - rustc_driver[8fc339cf4408bec4]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7ffaf1020bad - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h813f31c5cc72640d
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2032:9
  12:     0x7ffaf1020bad - std::panicking::rust_panic_with_hook::h2e61684db9120e8e
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:692:13
  13:     0x7ffaf04c0e81 - std[14b7645e29e8dad4]::panicking::begin_panic::<rustc_errors[5442e185e098f882]::ExplicitBug>::{closure#0}
  14:     0x7ffaf04c06d6 - std[14b7645e29e8dad4]::sys_common::backtrace::__rust_end_short_backtrace::<std[14b7645e29e8dad4]::panicking::begin_panic<rustc_errors[5442e185e098f882]::ExplicitBug>::{closure#0}, !>
  15:     0x7ffaf04e9036 - std[14b7645e29e8dad4]::panicking::begin_panic::<rustc_errors[5442e185e098f882]::ExplicitBug>
  16:     0x7ffaf04da196 - std[14b7645e29e8dad4]::panic::panic_any::<rustc_errors[5442e185e098f882]::ExplicitBug>
  17:     0x7ffaf04d92c2 - <rustc_errors[5442e185e098f882]::HandlerInner>::span_bug::<rustc_span[fd000e025c1fef5b]::span_encoding::Span, &alloc[1a97d1c4ba9fe4a2]::string::String>
  18:     0x7ffaf04d6487 - <rustc_errors[5442e185e098f882]::Handler>::span_bug::<rustc_span[fd000e025c1fef5b]::span_encoding::Span, &alloc[1a97d1c4ba9fe4a2]::string::String>
  19:     0x7ffaf0479129 - rustc_middle[1a40b9d11a76de60]::ty::context::tls::with_context_opt::<rustc_middle[1a40b9d11a76de60]::ty::context::tls::with_opt<rustc_middle[1a40b9d11a76de60]::util::bug::opt_span_bug_fmt<rustc_span[fd000e025c1fef5b]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7ffaf0478236 - rustc_middle[1a40b9d11a76de60]::util::bug::opt_span_bug_fmt::<rustc_span[fd000e025c1fef5b]::span_encoding::Span>
  21:     0x7ffaeef84064 - rustc_middle[1a40b9d11a76de60]::util::bug::span_bug_fmt::<rustc_span[fd000e025c1fef5b]::span_encoding::Span>
  22:     0x7ffaedf454a1 - <rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::DropCtxt<rustc_mir_transform[466f52074d601c49]::elaborate_drops::Elaborator>>::elaborate_drop
  23:     0x7ffaedf4ae2d - <alloc[1a97d1c4ba9fe4a2]::vec::Vec<rustc_middle[1a40b9d11a76de60]::mir::BasicBlock> as alloc[1a97d1c4ba9fe4a2]::vec::spec_from_iter::SpecFromIter<rustc_middle[1a40b9d11a76de60]::mir::BasicBlock, core[486592e7c49a8aa]::iter::adapters::chain::Chain<core[486592e7c49a8aa]::iter::sources::once::Once<rustc_middle[1a40b9d11a76de60]::mir::BasicBlock>, core[486592e7c49a8aa]::iter::adapters::map::Map<core[486592e7c49a8aa]::iter::adapters::zip::Zip<core[486592e7c49a8aa]::iter::adapters::rev::Rev<core[486592e7c49a8aa]::slice::iter::Iter<(rustc_middle[1a40b9d11a76de60]::mir::syntax::Place, core[486592e7c49a8aa]::option::Option<rustc_mir_dataflow[48ba6c1fd6c1a861]::move_paths::MovePathIndex>)>>, core[486592e7c49a8aa]::slice::iter::Iter<rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::Unwind>>, <rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::DropCtxt<rustc_mir_transform[466f52074d601c49]::elaborate_drops::Elaborator>>::drop_halfladder::{closure#0}>>>>::from_iter
  24:     0x7ffaedf4a0a5 - <rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::DropCtxt<rustc_mir_transform[466f52074d601c49]::elaborate_drops::Elaborator>>::drop_ladder
  25:     0x7ffaedf49e17 - <rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::DropCtxt<rustc_mir_transform[466f52074d601c49]::elaborate_drops::Elaborator>>::open_drop_for_tuple
  26:     0x7ffaedf43b54 - <rustc_mir_dataflow[48ba6c1fd6c1a861]::elaborate_drops::DropCtxt<rustc_mir_transform[466f52074d601c49]::elaborate_drops::Elaborator>>::elaborate_drop
  27:     0x7ffaeeeea955 - <rustc_mir_transform[466f52074d601c49]::elaborate_drops::ElaborateDrops as rustc_middle[1a40b9d11a76de60]::mir::MirPass>::run_pass
  28:     0x7ffaee87d348 - rustc_mir_transform[466f52074d601c49]::run_analysis_to_runtime_passes
  29:     0x7ffaee87c0e0 - rustc_mir_transform[466f52074d601c49]::mir_drops_elaborated_and_const_checked
  30:     0x7ffaee7d389b - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_middle[1a40b9d11a76de60]::ty::WithOptConstParam<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId>, &rustc_data_structures[9df8088a57e7e2f7]::steal::Steal<rustc_middle[1a40b9d11a76de60]::mir::Body>>
  31:     0x7ffaee7d21f1 - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::DefaultCache<rustc_middle[1a40b9d11a76de60]::ty::WithOptConstParam<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId>, &rustc_data_structures[9df8088a57e7e2f7]::steal::Steal<rustc_middle[1a40b9d11a76de60]::mir::Body>>>
  32:     0x7ffaee78c1e1 - rustc_mir_transform[466f52074d601c49]::optimized_mir
  33:     0x7ffaee78b90f - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::DefId, &rustc_middle[1a40b9d11a76de60]::mir::Body>
  34:     0x7ffaee786a51 - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::DefaultCache<rustc_span[fd000e025c1fef5b]::def_id::DefId, &rustc_middle[1a40b9d11a76de60]::mir::Body>>
  35:     0x7ffaef149933 - <rustc_metadata[ff8e2c172980b3b4]::rmeta::encoder::EncodeContext>::encode_crate_root
  36:     0x7ffaef0df435 - rustc_metadata[ff8e2c172980b3b4]::rmeta::encoder::encode_metadata_impl
  37:     0x7ffaef0d8b3e - rustc_data_structures[9df8088a57e7e2f7]::sync::join::<rustc_metadata[ff8e2c172980b3b4]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[ff8e2c172980b3b4]::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
  38:     0x7ffaef0d8841 - rustc_metadata[ff8e2c172980b3b4]::rmeta::encoder::encode_metadata
  39:     0x7ffaef0d7aa6 - rustc_metadata[ff8e2c172980b3b4]::fs::encode_and_write_metadata
  40:     0x7ffaef0c71ae - rustc_interface[58e4822cc60d2a6c]::passes::start_codegen
  41:     0x7ffaef0c4f06 - <rustc_interface[58e4822cc60d2a6c]::passes::QueryContext>::enter::<<rustc_interface[58e4822cc60d2a6c]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[486592e7c49a8aa]::result::Result<alloc[1a97d1c4ba9fe4a2]::boxed::Box<dyn core[486592e7c49a8aa]::any::Any>, rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  42:     0x7ffaef0c23b6 - <rustc_interface[58e4822cc60d2a6c]::queries::Queries>::ongoing_codegen
  43:     0x7ffaef0c18d7 - <rustc_interface[58e4822cc60d2a6c]::interface::Compiler>::enter::<rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}::{closure#2}, core[486592e7c49a8aa]::result::Result<core[486592e7c49a8aa]::option::Option<rustc_interface[58e4822cc60d2a6c]::queries::Linker>, rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  44:     0x7ffaef0bc8b8 - rustc_span[fd000e025c1fef5b]::with_source_map::<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  45:     0x7ffaef0bc3a5 - <scoped_tls[2f862aa259e87453]::ScopedKey<rustc_span[fd000e025c1fef5b]::SessionGlobals>>::set::<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  46:     0x7ffaef0bb992 - std[14b7645e29e8dad4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[58e4822cc60d2a6c]::util::run_in_thread_pool_with_globals<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  47:     0x7ffaef6f2c1a - <<std[14b7645e29e8dad4]::thread::Builder>::spawn_unchecked_<rustc_interface[58e4822cc60d2a6c]::util::run_in_thread_pool_with_globals<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#1} as core[486592e7c49a8aa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  48:     0x7ffaf102a983 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdbff13d45d6b3b01\n                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2000:9
  49:     0x7ffaf102a983 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1e5384a2b7a0037a\n                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2000:9
  50:     0x7ffaf102a983 - std::sys::unix::thread::Thread::new::thread_start::h4b8540c4f94d9763
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys/unix/thread.rs:108:17
  51:     0x7ffaec890402 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  52:     0x7ffaec91f590 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  53:                0x0 - <unknown>

note: rustc 1.68.0-nightly (0468a00ae 2022-12-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `mock_server::<impl at pact_mock_server/src/mock_server.rs:120:1: 120:16>::new::{closure#0}`
#1 [optimized_mir] optimizing MIR for `mock_server::<impl at pact_mock_server/src/mock_server.rs:120:1: 120:16>::new::{closure#0}`
end of query stack
error: could not compile `pact_mock_server`

Caused by:
  process didn't exit successfully: `rustc --crate-name pact_mock_server --edition=2021 pact_mock_server/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=e9cf0c3c0a580219 -C extra-filename=-e9cf0c3c0a580219 --out-dir /home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps -C incremental=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/incremental -L dependency=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps --extern anyhow=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libanyhow-3187dfc7d03798d3.rmeta --extern bytes=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libbytes-dc2a23bb18d2d90f.rmeta --extern futures=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libfutures-0db157998510b3f7.rmeta --extern hyper=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libhyper-d3084614b8d67500.rmeta --extern hyper_rustls=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libhyper_rustls-68a4535c338fa03a.rmeta --extern itertools=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libitertools-834616629779ca0a.rmeta --extern lazy_static=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/liblazy_static-3ab14ef94a1f89cf.rmeta --extern maplit=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libmaplit-89b324ce4249d94e.rmeta --extern pact_plugin_driver=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libpact_plugin_driver-3ae5689b4a54a8af.rmeta --extern pact_matching=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libpact_matching-f39e842a307eb025.rmeta --extern pact_models=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libpact_models-9b10206b5fe1cc9b.rmeta --extern rustls=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/librustls-4aee97a09c0575d1.rmeta --extern rustls_pemfile=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/librustls_pemfile-716f037f98382131.rmeta --extern serde=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libserde-3b4dedb1aa546273.rmeta --extern serde_json=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libserde_json-26c54950645ad8fa.rmeta --extern thiserror=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libthiserror-374cd6b514c9b1ad.rmeta --extern tokio=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libtokio-ce74bf31b396f1c4.rmeta --extern tokio_rustls=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libtokio_rustls-d802fdd24c4682c7.rmeta --extern tracing=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libtracing-1a8ab389ec0d1ce5.rmeta --extern tracing_core=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libtracing_core-1028932204319d6b.rmeta --extern url=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/liburl-6889d76684c16d97.rmeta --extern uuid=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/deps/libuuid-1b60a4b4398a542a.rmeta -L native=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/build/ring-7e30325d849067bf/out -L native=/home/ronald/Development/Projects/Pact/pact-reference/rust/target/debug/build/onig_sys-028951401dcde764/out` (exit status: 101)
@rholshausen rholshausen 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 Dec 19, 2022
@albertlarsan68
Copy link
Member

searched nightlies: from nightly-2022-12-15 to nightly-2022-12-19
regressed nightly: nightly-2022-12-17
searched commit range: ec56537...9c07efe
regressed commit: 03770f0 (#103880, cc @b-naber and @lcnr)

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-pc-windows-msvc
Reproduce with:

cargo bisect-rustc --preserve --access github --script bisect.bat

at pact-foundation/pact-reference@09479b9
and bisect.bat eventually running cbindgen --config cbindgen.toml --crate pact_ffi with the correct toolchain

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 19, 2022
Revert rust-lang#103880 "Use non-ascribed type as field's type in mir"

This PR prepares a revert for rust-lang#103880 to fix rust-lang#105809, rust-lang#105881, rust-lang#105886 and others (like the duplicates of the first one), in case an actual fix can't get done today.

I've also added the MCVE from rust-lang#105809. There is no MCVE for the rust-lang#105881 and rust-lang#105886 ICEs yet however, so there are no tests for them here, although we'll need one before relanding the original changes.

Were this PR to land, it would also reopen rust-lang#96514 as it was fixed by the original PR.

Opening as draft to allow time for a possible fix.

r? `@jackh726`
@lqd
Copy link
Member

lqd commented Dec 20, 2022

This should be fixed in tomorrow's nightly now that #105905 has been merged. However, it would be great to have a minimal example that we could add as a non-regression test.

@lqd lqd added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Dec 20, 2022
@trinity-1686a
Copy link
Contributor

trinity-1686a commented Dec 20, 2022

I worked on an MCVE. It's maybe not minimal yet, but it's standalone. It only works when building as a library (lib.rs), not from a binary (main.rs)

use std::future::{pending, Future};

async fn handle_request() -> Result<(), String> {
    loop {}
}

struct Server<S> {
    _make_service: S,
}

impl Server<()> {
    pub fn bind<S>(_make_service: S) -> Server<S> {
        loop {}
    }
}
impl<T> Server<T> {
    fn with_graceful_shutdown<>(self) -> impl Future<Output = ()>
    {
        pending()
    }
}

pub(crate) async fn create_and_bind(
    _: impl Future<Output = ()>,
) -> (impl Future<Output = ()>,) {
    let server = Server::bind(handle_request().await);

    (async { server.with_graceful_shutdown().await; },)
}

pub async fn new() -> Result<(), String> {
    let (_future,) = create_and_bind(async { pending().await }).await;

    Ok(())
}

cc @b-naber

@b-naber
Copy link
Contributor

b-naber commented Dec 21, 2022

Thanks a lot.

@apiraino
Copy link
Contributor

should be closed by #105905

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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
6 participants