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

debug_assert at compiler/rustc_typeck/src/check/generator_interior.rs:542:17 #91334

Closed
Badel2 opened this issue Nov 28, 2021 · 2 comments · Fixed by #91367
Closed

debug_assert at compiler/rustc_typeck/src/check/generator_interior.rs:542:17 #91334

Badel2 opened this issue Nov 28, 2021 · 2 comments · Fixed by #91367
Labels
A-coroutines Area: Coroutines C-bug Category: This is a bug. F-coroutines `#![feature(coroutines)]` 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

@Badel2
Copy link
Contributor

Badel2 commented Nov 28, 2021

This debug_assert:

debug_assert_eq!(comps.len(), tys.len());

Is triggered by the following input, found by fuzz-rustc:

Code

fn f(){||yield(((){),

Error output

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `2`', compiler/rustc_typeck/src/check/generator_interior.rs:542:17
Backtrace

error: this file contains an unclosed delimiter
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:23
   |
LL | fn f(){||yield(((){),
   |       -       -       ^
   |       |       |
   |       |       unclosed delimiter
   |       unclosed delimiter

error: this file contains an unclosed delimiter
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:23
   |
LL | fn f(){||yield(((){),
   |       -       -       ^
   |       |       |
   |       |       unclosed delimiter
   |       unclosed delimiter

error: expected one of `)`, `,`, `.`, `?`, or an operator, found `{`
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:19
   |
LL | fn f(){||yield(((){),
   |                   ^
   |                   |
   |                   expected one of `)`, `,`, `.`, `?`, or an operator
   |                   help: missing `,`

error: mismatched closing delimiter: `)`
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:19
   |
LL | fn f(){||yield(((){),
   |                -  ^^ mismatched closing delimiter
   |                |  |
   |                |  unclosed delimiter
   |                closing delimiter possibly meant for this

error[E0658]: yield syntax is experimental
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:10
   |
LL | fn f(){||yield(((){),
   |          ^^^^^^^^^^^^^
   |
   = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
   = help: add `#![feature(generators)]` to the crate attributes to enable

error[E0308]: mismatched types
  --> /home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:8
   |
LL | fn f(){||yield(((){),
   |       -^^^^^^^^^^^^^^^ expected `()`, found generator
   |       |
   |       help: try adding a return type: `-> [generator@/home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:8: 1:23]`
   |
   = note: expected unit type `()`
              found generator `[generator@/home/bdl/projects/contrib/rust/src/test/ui/ice-yield.rs:1:8: 1:23]`

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `2`', compiler/rustc_typeck/src/check/generator_interior.rs:542:17
stack backtrace:
   0: rust_begin_unwind
             at ./library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at ./library/core/src/panicking.rs:107:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<usize, usize>
             at ./library/core/src/panicking.rs:145:5
   4: rustc_typeck::check::generator_interior::check_must_not_suspend_ty
             at ./compiler/rustc_typeck/src/check/generator_interior.rs:542:17
   5: rustc_typeck::check::generator_interior::check_must_not_suspend_ty
             at ./compiler/rustc_typeck/src/check/generator_interior.rs:550:20
   6: <rustc_typeck::check::generator_interior::InteriorVisitor>::record
             at ./compiler/rustc_typeck/src/check/generator_interior.rs:127:21
   7: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc_hir::intravisit::Visitor>::visit_expr
             at ./compiler/rustc_typeck/src/check/generator_interior.rs:368:13
   8: <rustc_typeck::check::generator_interior::InteriorVisitor as rustc_hir::intravisit::Visitor>::visit_expr
   9: rustc_typeck::check::generator_interior::resolve_interior
             at ./compiler/rustc_typeck/src/check/generator_interior.rs:190:5
  10: <rustc_typeck::check::fn_ctxt::FnCtxt>::resolve_generator_interiors
             at ./compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:605:13
  11: rustc_typeck::check::typeck_with_fallback::<rustc_typeck::check::typeck::{closure#0}>::{closure#1}
             at ./compiler/rustc_typeck/src/check/mod.rs:468:9
  12: <rustc_typeck::check::inherited::InheritedBuilder>::enter::<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_typeck/src/check/inherited.rs:99:34
  13: <rustc_infer::infer::InferCtxtBuilder>::enter::<&rustc_middle::ty::context::TypeckResults, <rustc_typeck::check::inherited::InheritedBuilder>::enter<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
             at ./compiler/rustc_infer/src/infer/mod.rs:612:9
  14: <rustc_typeck::check::inherited::InheritedBuilder>::enter::<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_typeck/src/check/inherited.rs:99:9
  15: rustc_typeck::check::typeck_with_fallback::<rustc_typeck::check::typeck::{closure#0}>
             at ./compiler/rustc_typeck/src/check/mod.rs:365:26
  16: rustc_typeck::check::typeck
             at ./compiler/rustc_typeck/src/check/mod.rs:330:9
  17: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:103:17
  18: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1783:50
  19: rustc_middle::ty::context::tls::set_tlv::<rustc_middle::ty::context::tls::enter_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1767:9
  20: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1783:9
  21: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:102:13
  22: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1827:13
  23: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1811:40
  24: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_context<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1800:22
  25: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1811:9
  26: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1824:9
  27: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
             at ./compiler/rustc_query_impl/src/plumbing.rs:91:9
  28: rustc_query_system::query::plumbing::execute_job::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:443:22
  29: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:401:44
  30: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:756:36
  31: <rustc_middle::ty::query::TyCtxtAt>::typeck
             at ./compiler/rustc_middle/src/ty/query.rs:239:17
  32: <rustc_middle::ty::context::TyCtxt>::typeck
             at ./compiler/rustc_middle/src/ty/query.rs:222:17
  33: rustc_typeck::check::typeck_with_fallback::<rustc_typeck::check::typeck::{closure#0}>
             at ./compiler/rustc_typeck/src/check/mod.rs:353:16
  34: rustc_typeck::check::typeck
             at ./compiler/rustc_typeck/src/check/mod.rs:330:9
  35: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:103:17
  36: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1783:50
  37: rustc_middle::ty::context::tls::set_tlv::<rustc_middle::ty::context::tls::enter_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1767:9
  38: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1783:9
  39: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:102:13
  40: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1827:13
  41: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1811:40
  42: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_context<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1800:22
  43: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1811:9
  44: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>::{closure#0}, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_middle/src/ty/context.rs:1824:9
  45: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<&rustc_middle::ty::context::TypeckResults, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
             at ./compiler/rustc_query_impl/src/plumbing.rs:91:9
  46: rustc_query_system::query::plumbing::execute_job::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:443:22
  47: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:401:44
  48: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:756:36
  49: <rustc_middle::ty::query::TyCtxtEnsure>::typeck
             at ./compiler/rustc_middle/src/ty/query.rs:212:17
  50: rustc_typeck::check::typeck_item_bodies::{closure#0}
             at ./compiler/rustc_typeck/src/check/mod.rs:921:51
  51: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}::{closure#0}
             at ./compiler/rustc_middle/src/hir/map/mod.rs:526:21
  52: <core::slice::iter::Iter<(rustc_hir::hir_id::ItemLocalId, &rustc_hir::hir::Body)> as core::iter::traits::iterator::Iterator>::for_each::<<rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}::{closure#0}>
             at ./library/core/src/slice/iter/macros.rs:211:21
  53: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}
             at ./compiler/rustc_middle/src/hir/map/mod.rs:523:17
  54: core::iter::traits::iterator::Iterator::for_each::call::<(usize, &core::option::Option<rustc_hir::hir::OwnerInfo>), <rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}
             at ./library/core/src/iter/traits/iterator.rs:733:29
  55: <core::iter::adapters::enumerate::Enumerate<_> as core::iter::traits::iterator::Iterator>::fold::enumerate::<&core::option::Option<rustc_hir::hir::OwnerInfo>, (), core::iter::traits::iterator::Iterator::for_each::call<(usize, &core::option::Option<rustc_hir::hir::OwnerInfo>), <rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}
             at ./library/core/src/iter/adapters/enumerate.rs:106:27
  56: <core::slice::iter::Iter<core::option::Option<rustc_hir::hir::OwnerInfo>> as core::iter::traits::iterator::Iterator>::fold::<(), <core::iter::adapters::enumerate::Enumerate<_> as core::iter::traits::iterator::Iterator>::fold::enumerate<&core::option::Option<rustc_hir::hir::OwnerInfo>, (), core::iter::traits::iterator::Iterator::for_each::call<(usize, &core::option::Option<rustc_hir::hir::OwnerInfo>), <rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>
             at ./library/core/src/iter/traits/iterator.rs:2170:21
  57: <core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<core::option::Option<rustc_hir::hir::OwnerInfo>>> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<(usize, &core::option::Option<rustc_hir::hir::OwnerInfo>), <rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}>
             at ./library/core/src/iter/adapters/enumerate.rs:112:9
  58: <core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<core::option::Option<rustc_hir::hir::OwnerInfo>>> as core::iter::traits::iterator::Iterator>::for_each::<<rustc_middle::hir::map::Map>::par_body_owners<rustc_typeck::check::typeck_item_bodies::{closure#0}>::{closure#0}>
             at ./library/core/src/iter/traits/iterator.rs:736:9
  59: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>
             at ./compiler/rustc_middle/src/hir/map/mod.rs:520:9
  60: rustc_typeck::check::typeck_item_bodies
             at ./compiler/rustc_typeck/src/check/mod.rs:921:5
  61: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:103:17
  62: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}::{closure#0}, ()>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1783:50
  63: rustc_middle::ty::context::tls::set_tlv::<rustc_middle::ty::context::tls::enter_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}::{closure#0}, ()>::{closure#0}, ()>
             at ./compiler/rustc_middle/src/ty/context.rs:1767:9
  64: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}::{closure#0}, ()>
             at ./compiler/rustc_middle/src/ty/context.rs:1783:9
  65: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:102:13
  66: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}, ()>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1827:13
  67: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1811:40
  68: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_context<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>::{closure#0}, ()>
             at ./compiler/rustc_middle/src/ty/context.rs:1800:22
  69: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>
             at ./compiler/rustc_middle/src/ty/context.rs:1811:9
  70: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>::{closure#0}, ()>
             at ./compiler/rustc_middle/src/ty/context.rs:1824:9
  71: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<(), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), ()>::{closure#0}>
             at ./compiler/rustc_query_impl/src/plumbing.rs:91:9
  72: rustc_query_system::query::plumbing::execute_job::<rustc_query_impl::plumbing::QueryCtxt, (), ()>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:443:22
  73: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:401:44
  74: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:756:36
  75: <rustc_middle::ty::query::TyCtxtAt>::typeck_item_bodies
             at ./compiler/rustc_middle/src/ty/query.rs:239:17
  76: <rustc_middle::ty::context::TyCtxt>::typeck_item_bodies
             at ./compiler/rustc_middle/src/ty/query.rs:222:17
  77: rustc_typeck::check_crate::{closure#7}
             at ./compiler/rustc_typeck/src/lib.rs:536:46
  78: <rustc_data_structures::profiling::VerboseTimingGuard>::run::<(), rustc_typeck::check_crate::{closure#7}>
             at ./compiler/rustc_data_structures/src/profiling.rs:644:9
  79: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#7}>
             at ./compiler/rustc_session/src/utils.rs:16:9
  80: rustc_typeck::check_crate
             at ./compiler/rustc_typeck/src/lib.rs:536:5
  81: rustc_interface::passes::analysis
             at ./compiler/rustc_interface/src/passes.rs:910:5
  82: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:103:17
  83: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1783:50
  84: rustc_middle::ty::context::tls::set_tlv::<rustc_middle::ty::context::tls::enter_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1767:9
  85: rustc_middle::ty::context::tls::enter_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1783:9
  86: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:102:13
  87: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1827:13
  88: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1811:40
  89: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_context<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1800:22
  90: rustc_middle::ty::context::tls::with_context::<rustc_middle::ty::context::tls::with_related_context<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1811:9
  91: rustc_middle::ty::context::tls::with_related_context::<<rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1824:9
  92: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::start_query::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}>
             at ./compiler/rustc_query_impl/src/plumbing.rs:91:9
  93: rustc_query_system::query::plumbing::execute_job::<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:443:22
  94: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorReported>>>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:401:44
  95: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             at ./compiler/rustc_query_system/src/query/plumbing.rs:756:36
  96: <rustc_middle::ty::query::TyCtxtAt>::analysis
             at ./compiler/rustc_middle/src/ty/query.rs:239:17
  97: <rustc_middle::ty::context::TyCtxt>::analysis
             at ./compiler/rustc_middle/src/ty/query.rs:222:17
  98: rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}
             at ./compiler/rustc_driver/src/lib.rs:386:30
  99: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_interface/src/passes.rs:805:42
 100: rustc_middle::ty::context::tls::enter_context::<<rustc_interface::passes::QueryContext>::enter<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_middle/src/ty/context.rs:1783:50
 101: rustc_middle::ty::context::tls::set_tlv::<rustc_middle::ty::context::tls::enter_context<<rustc_interface::passes::QueryContext>::enter<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1767:9
 102: rustc_middle::ty::context::tls::enter_context::<<rustc_interface::passes::QueryContext>::enter<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_middle/src/ty/context.rs:1783:9
 103: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>
             at ./compiler/rustc_interface/src/passes.rs:805:9
 104: rustc_driver::run_compiler::{closure#1}::{closure#2}
             at ./compiler/rustc_driver/src/lib.rs:385:13
 105: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorReported>>
             at ./compiler/rustc_interface/src/queries.rs:390:19
 106: rustc_driver::run_compiler::{closure#1}
             at ./compiler/rustc_driver/src/lib.rs:314:22
 107: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}
             at ./compiler/rustc_interface/src/interface.rs:220:13
 108: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
             at ./compiler/rustc_span/src/lib.rs:971:5
 109: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>
             at ./compiler/rustc_interface/src/interface.rs:214:5
 110: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}
             at ./compiler/rustc_interface/src/interface.rs:236:12
 111: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}
             at ./compiler/rustc_interface/src/util.rs:145:13
 112: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
             at /home/bdl/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
 113: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}>
             at ./compiler/rustc_span/src/lib.rs:109:5
 114: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}
             at ./compiler/rustc_interface/src/util.rs:143:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: 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: rustc 1.59.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -C codegen-units=1 -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [typeck] type-checking `f`
#1 [typeck] type-checking `f::{closure#0}`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 6 previous errors

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

@Badel2 Badel2 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 Nov 28, 2021
@FabianWolff
Copy link
Contributor

Reduced (in terms of unrelated errors):

#![feature(generators)]

fn f() {
    || yield ((1,1),);
}

@jhpratt

This comment has been minimized.

@rustbot rustbot added A-coroutines Area: Coroutines F-coroutines `#![feature(coroutines)]` requires-nightly This issue requires a nightly compiler in some way. labels Nov 30, 2021
@bors bors closed this as completed in bd98a79 Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coroutines Area: Coroutines C-bug Category: This is a bug. F-coroutines `#![feature(coroutines)]` 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

Successfully merging a pull request may close this issue.

4 participants