Skip to content

ICE: src/librustc/middle/region.rs:1037: Encountered greater count 28 #69307

@Kumassy

Description

@Kumassy

Code

use tokio::prelude::*; use tokio::runtime::Runtime; use tokio::sync::mpsc; fn main() { let mut rt = Runtime::new().unwrap(); let mut sum = 0; sum += rt.block_on(async { let (tx, mut rx) = mpsc::unbounded_channel(); tx.send(1).unwrap(); while let Some(res) = rx.recv().await { println!("{:?}", res); } 1 }); }

Playground Link

Meta

rustc --version --verbose:

rustc 1.41.0 (5e1a79984 2020-01-27) binary: rustc commit-hash: 5e1a799842ba6ed4a57e91f7ab9435947482f7d8 commit-date: 2020-01-27 host: x86_64-unknown-linux-gnu release: 1.41.0 LLVM version: 9.0 

Same issue still exists in rustc +beta --version --verbose:

rustc 1.42.0-beta.3 (86f329b41 2020-02-07) binary: rustc commit-hash: 86f329b419dbac59da59e2ac7d6e21e5eb679ec7 commit-date: 2020-02-07 host: x86_64-unknown-linux-gnu release: 1.42.0-beta.3 LLVM version: 9.0 

and also in rustc +nightly --version --verbose:

rustc 1.43.0-nightly (7760cd0fb 2020-02-19) binary: rustc commit-hash: 7760cd0fbbbf2c59a625e075a5bdfa88b8e30f8a commit-date: 2020-02-19 host: x86_64-unknown-linux-gnu release: 1.43.0-nightly LLVM version: 9.0 

Error output

error: internal compiler error: src/librustc/middle/region.rs:1037: Encountered greater count 28 at span src/main.rs:13:31: 13:46 - expected no greater than 12 thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:905:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.41.0 (5e1a79984 2020-01-27) running on x86_64-unknown-linux-gnu note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin note: some of the compiler flags provided by cargo are hidden error: aborting due to previous error 
Backtrace

error: internal compiler error: src/librustc/middle/region.rs:1037: Encountered greater count 28 at span src/main.rs:13:31: 13:46 - expected no greater than 12 thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:905:9 stack backtrace: 0: backtrace::backtrace::libunwind::trace at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: backtrace::backtrace::trace_unsynchronized at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: std::sys_common::backtrace::_print_fmt at src/libstd/sys_common/backtrace.rs:84 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt at src/libstd/sys_common/backtrace.rs:61 4: core::fmt::write at src/libcore/fmt/mod.rs:1025 5: std::io::Write::write_fmt at src/libstd/io/mod.rs:1426 6: std::sys_common::backtrace::_print at src/libstd/sys_common/backtrace.rs:65 7: std::sys_common::backtrace::print at src/libstd/sys_common/backtrace.rs:50 8: std::panicking::default_hook::{{closure}} at src/libstd/panicking.rs:193 9: std::panicking::default_hook at src/libstd/panicking.rs:210 10: rustc_driver::report_ice 11: std::panicking::rust_panic_with_hook at src/libstd/panicking.rs:475 12: std::panicking::begin_panic 13: rustc_errors::HandlerInner::bug 14: rustc_errors::Handler::bug 15: rustc::util::bug::opt_span_bug_fmt::{{closure}} 16: rustc::ty::context::tls::with_opt::{{closure}} 17: rustc::ty::context::tls::with_opt 18: rustc::util::bug::opt_span_bug_fmt 19: rustc::util::bug::bug_fmt 20: rustc::middle::region::resolve_expr 21: <rustc::middle::region::RegionResolutionVisitor as rustc::hir::intravisit::Visitor>::visit_stmt 22: <rustc::middle::region::RegionResolutionVisitor as rustc::hir::intravisit::Visitor>::visit_block 23: rustc::middle::region::resolve_expr 24: <rustc::middle::region::RegionResolutionVisitor as rustc::hir::intravisit::Visitor>::visit_body 25: rustc::middle::region::region_scope_tree 26: rustc::ty::query::__query_compute::region_scope_tree 27: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::region_scope_tree>::compute 28: rustc::dep_graph::graph::DepGraph::with_task_impl 29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 30: rustc_typeck::check::generator_interior::resolve_interior 31: rustc_typeck::check::FnCtxt::resolve_generator_interiors 32: rustc::ty::context::tls::with_context::{{closure}} 33: rustc_typeck::check::typeck_tables_of 34: rustc::ty::query::__query_compute::typeck_tables_of 35: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute 36: rustc::dep_graph::graph::DepGraph::with_task_impl 37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 38: rustc::ty::query::__query_compute::typeck_tables_of 39: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute 40: rustc::dep_graph::graph::DepGraph::with_task_impl 41: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 42: rustc_typeck::collect::type_of 43: rustc::ty::query::__query_compute::type_of 44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::type_of>::compute 45: rustc::dep_graph::graph::DepGraph::with_task_impl 46: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 47: rustc::hir::intravisit::walk_expr 48: rustc::hir::intravisit::walk_expr 49: rustc::hir::intravisit::walk_expr 50: rustc::hir::intravisit::walk_block 51: rustc::hir::intravisit::Visitor::visit_fn 52: rustc::hir::intravisit::walk_item 53: <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item 54: rustc::hir::map::Map::visit_item_likes_in_module 55: rustc_typeck::collect::collect_mod_item_types 56: rustc::ty::query::__query_compute::collect_mod_item_types 57: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute 58: rustc::dep_graph::graph::DepGraph::with_task_impl 59: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 60: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query 61: rustc_typeck::check_crate::{{closure}}::{{closure}} 62: rustc::util::common::time 63: rustc_typeck::check_crate 64: rustc_interface::passes::analysis 65: rustc::ty::query::__query_compute::analysis 66: rustc::dep_graph::graph::DepGraph::with_task_impl 67: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query 68: rustc::ty::context::tls::enter_global 69: rustc_interface::interface::run_compiler_in_existing_thread_pool 70: std::thread::local::LocalKey<T>::with 71: scoped_tls::ScopedKey<T>::set 72: syntax::with_globals note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.41.0 (5e1a79984 2020-01-27) running on x86_64-unknown-linux-gnu note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [region_scope_tree] processing `main` #1 [typeck_tables_of] processing `main` #2 [typeck_tables_of] processing `main::{{closure}}#0` #3 [type_of] processing `main::{{closure}}#0` #4 [collect_mod_item_types] collecting item types in top-level module #5 [analysis] running analysis passes on this crate end of query stack error: aborting due to previous error 

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions