Skip to content

ICE: yield: itertools: .zip_eq() reached end of one iterator before the other #139570

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
matthiaskrgr opened this issue Apr 9, 2025 · 1 comment
Labels
C-bug Category: This is a bug. F-coroutines `#![feature(coroutines)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

fn main() {
    |(1, 42), ()| yield;
}

original:

#![feature(coroutines)]

fn main() {
    #[coroutine]
    |(1, 42), ()| {
        //~^ error: too many parameters for a coroutine
        yield
    };
}

Version information

rustc 1.88.0-nightly (c1b8b7e86 2025-04-09)
binary: rustc
commit-hash: c1b8b7e86f6ca59929ce08471d0877f748f84901
commit-date: 2025-04-09
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0658]: yield syntax is experimental
 --> /tmp/icemaker_global_tempdir.cuDMHPQVcDO1/rustc_testrunner_tmpdir_reporting.HvMRq01KpEvD/mvce.rs:2:19
  |
2 |     |(1, 42), ()| yield;
  |                   ^^^^^
  |
  = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
  = help: add `#![feature(coroutines)]` to the crate attributes to enable
  = note: this compiler was built on 2025-04-09; consider upgrading it if it is out of date

error[E0658]: yield syntax is experimental
 --> /tmp/icemaker_global_tempdir.cuDMHPQVcDO1/rustc_testrunner_tmpdir_reporting.HvMRq01KpEvD/mvce.rs:2:19
  |
2 |     |(1, 42), ()| yield;
  |                   ^^^^^
  |
  = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
  = help: add `#![feature(yield_expr)]` to the crate attributes to enable
  = note: this compiler was built on 2025-04-09; consider upgrading it if it is out of date

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
 --> /tmp/icemaker_global_tempdir.cuDMHPQVcDO1/rustc_testrunner_tmpdir_reporting.HvMRq01KpEvD/mvce.rs:2:19
  |
2 |     |(1, 42), ()| yield;
  |                   ^^^^^
  |
help: use `#[coroutine]` to make this closure a coroutine
  |
2 |     #[coroutine] |(1, 42), ()| yield;
  |     ++++++++++++

error[E0628]: too many parameters for a coroutine (expected 0 or 1 parameters)
 --> /tmp/icemaker_global_tempdir.cuDMHPQVcDO1/rustc_testrunner_tmpdir_reporting.HvMRq01KpEvD/mvce.rs:2:5
  |
2 |     |(1, 42), ()| yield;
  |     ^^^^^^^^^^^^^

error[E0005]: refutable pattern in closure argument
 --> /tmp/icemaker_global_tempdir.cuDMHPQVcDO1/rustc_testrunner_tmpdir_reporting.HvMRq01KpEvD/mvce.rs:2:6
  |
2 |     |(1, 42), ()| yield;
  |      ^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
  |
  = note: the matched value is of type `(i32, i32)`


thread 'rustc' panicked at /rust/deps/itertools-0.12.1/src/zip_eq_impl.rs:50:17:
itertools: .zip_eq() reached end of one iterator before the other
stack backtrace:
   0:     0x75a844499933 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h0a0d14a4b4d0a1f3
   1:     0x75a844c060d1 - core::fmt::write::hbb7b19f6d7e0bcfc
   2:     0x75a846015211 - std::io::Write::write_fmt::h56be00b0cfe11b12
   3:     0x75a844499792 - std::sys::backtrace::BacktraceLock::print::h2156a72749ab330b
   4:     0x75a84449d27a - std::panicking::default_hook::{{closure}}::hd80cd3ad4d1b138b
   5:     0x75a84449cdff - std::panicking::default_hook::hc85df78dfcd017bc
   6:     0x75a8434f4333 - std[8937284e1d156103]::panicking::update_hook::<alloc[791d046a9b050803]::boxed::Box<rustc_driver_impl[4798b47694e9a4e]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x75a84449daf3 - std::panicking::rust_panic_with_hook::h7debfdbac178bc11
   8:     0x75a84449d8fc - std::panicking::begin_panic::{{closure}}::hfc7f12f70922365f
   9:     0x75a844499e09 - std::sys::backtrace::__rust_end_short_backtrace::hc45c915fb58aa1f1
  10:     0x75a84189dfca - std::panicking::begin_panic::haf29001515796137
  11:     0x75a845e8c060 - rustc_borrowck[2022ef40105ff589]::do_mir_borrowck
  12:     0x75a845308a61 - <rustc_borrowck[2022ef40105ff589]::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  13:     0x75a845308d23 - <rustc_borrowck[2022ef40105ff589]::type_check::TypeChecker>::prove_closure_bounds
  14:     0x75a8412ccaa8 - <rustc_borrowck[2022ef40105ff589]::type_check::TypeChecker as rustc_middle[2f69441c7b8c6072]::mir::visit::Visitor>::visit_rvalue
  15:     0x75a84601e3a2 - <rustc_borrowck[2022ef40105ff589]::type_check::TypeChecker as rustc_middle[2f69441c7b8c6072]::mir::visit::Visitor>::visit_body
  16:     0x75a845e897f3 - rustc_borrowck[2022ef40105ff589]::do_mir_borrowck
  17:     0x75a845e76011 - rustc_borrowck[2022ef40105ff589]::mir_borrowck
  18:     0x75a845e75e99 - rustc_query_impl[f5219312e31376b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f5219312e31376b]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2f69441c7b8c6072]::query::erase::Erased<[u8; 8usize]>>
  19:     0x75a844e5866c - rustc_query_system[34faab385f980ea8]::query::plumbing::try_execute_query::<rustc_query_impl[f5219312e31376b]::DynamicConfig<rustc_data_structures[e19e56e5fac41727]::vec_cache::VecCache<rustc_span[c9c449304cafad9b]::def_id::LocalDefId, rustc_middle[2f69441c7b8c6072]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[34faab385f980ea8]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f5219312e31376b]::plumbing::QueryCtxt, false>
  20:     0x75a844e5800b - rustc_query_impl[f5219312e31376b]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  21:     0x75a845663894 - rustc_interface[f94293adc0883baa]::passes::run_required_analyses
  22:     0x75a845c286de - rustc_interface[f94293adc0883baa]::passes::analysis
  23:     0x75a845c286b3 - rustc_query_impl[f5219312e31376b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f5219312e31376b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2f69441c7b8c6072]::query::erase::Erased<[u8; 0usize]>>
  24:     0x75a845bebcbd - rustc_query_system[34faab385f980ea8]::query::plumbing::try_execute_query::<rustc_query_impl[f5219312e31376b]::DynamicConfig<rustc_query_system[34faab385f980ea8]::query::caches::SingleCache<rustc_middle[2f69441c7b8c6072]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f5219312e31376b]::plumbing::QueryCtxt, false>
  25:     0x75a845beb9b8 - rustc_query_impl[f5219312e31376b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  26:     0x75a845f4510b - rustc_interface[f94293adc0883baa]::passes::create_and_enter_global_ctxt::<core[3680d8b8220f16e8]::option::Option<rustc_interface[f94293adc0883baa]::queries::Linker>, rustc_driver_impl[4798b47694e9a4e]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  27:     0x75a845d4f379 - rustc_interface[f94293adc0883baa]::interface::run_compiler::<(), rustc_driver_impl[4798b47694e9a4e]::run_compiler::{closure#0}>::{closure#1}
  28:     0x75a845d2108f - std[8937284e1d156103]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f94293adc0883baa]::util::run_in_thread_with_globals<rustc_interface[f94293adc0883baa]::util::run_in_thread_pool_with_globals<rustc_interface[f94293adc0883baa]::interface::run_compiler<(), rustc_driver_impl[4798b47694e9a4e]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  29:     0x75a845d2196b - <<std[8937284e1d156103]::thread::Builder>::spawn_unchecked_<rustc_interface[f94293adc0883baa]::util::run_in_thread_with_globals<rustc_interface[f94293adc0883baa]::util::run_in_thread_pool_with_globals<rustc_interface[f94293adc0883baa]::interface::run_compiler<(), rustc_driver_impl[4798b47694e9a4e]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[3680d8b8220f16e8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x75a845d22d6b - std::sys::pal::unix::thread::Thread::new::thread_start::he61a55009bcf6a9c
  31:     0x75a83faa370a - <unknown>
  32:     0x75a83fb27aac - <unknown>
  33:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

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: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (c1b8b7e86 2025-04-09) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors

Some errors have detailed explanations: E0005, E0628, E0658.
For more information about an error, try `rustc --explain E0005`.

@rustbot label +F-coroutines

@matthiaskrgr matthiaskrgr 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 Apr 9, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-coroutines `#![feature(coroutines)]` labels Apr 9, 2025
@matthiaskrgr
Copy link
Member Author

bisects to #138499

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 17, 2025
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label May 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. F-coroutines `#![feature(coroutines)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. 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

3 participants