Closed fourbytes closed 1 year ago
Might be related to #83693.
Re-opening due to #99860
Here's a more minimal version:
type TransactionFuture<'__, O> = impl '__;
fn execute_transaction_fut<'f, F, O>() -> FnOnce(&Transaction) -> TransactionFuture<'_, O> {
f
}
This gives a slightly different error message, probably just due to updates in rustc since when this was first filed.
error: internal compiler error: compiler/rustc_hir_typeck/src/inherited.rs:130:13: escaping bound vars in predicate Obligation(predicate=Binder(TraitPredicate(<TransactionFuture<'_, O> as std::marker::Sized>, polarity:Positive), []), depth=0)
--> ice_min.rs:2:43
|
2 | fn execute_transaction_fut<'f, F, O>() -> FnOnce(&Transaction) -> TransactionFuture<'_, O> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rustc 1.70.0-nightly (ff4b772f8 2023-03-10)
binary: rustc
commit-hash: ff4b772f805ec1e1c1bd7e189ab8d5a4e3a6ef13
commit-date: 2023-03-10
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7
Minimized with treereduce
.
Triage: Fixed on the latest nightly, @rustbot labels: +E-needs-test
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` Compiling rust-playground v0.1.0 (/Users/fourbytes/Projects/rust-playground) thread 'rustc' panicked at 'assertion failed: !erased_self_ty.has_escaping_bound_vars()', compiler/rustc_trait_selection/src/opaque_types.rs:1182:5 stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic 3: rustc_trait_selection::opaque_types::Instantiator::fold_opaque_ty 4: as rustc_middle::ty::fold::TypeFolder>::fold_ty
5: rustc_middle::ty::fold::TypeFoldable::fold_with
6: rustc_trait_selection::opaque_types::Instantiator::fold_opaque_ty
7: as rustc_middle::ty::fold::TypeFolder>::fold_ty
8: rustc_typeck::check::fn_ctxt::_impl::::instantiate_opaque_types_from_value
9: rustc_typeck::check::check::check_fn
10: rustc_infer::infer::InferCtxtBuilder::enter
11: rustc_typeck::check::typeck
12: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
13: rustc_data_structures::stack::ensure_sufficient_stack
14: rustc_query_system::query::plumbing::force_query_with_job
15: rustc_query_system::query::plumbing::get_query_impl
16: ::typeck
17: rustc_typeck::collect::type_of::find_opaque_ty_constraints::ConstraintLocator::check
18: rustc_hir::intravisit::walk_item
19: rustc_typeck::collect::type_of::type_of
20: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
21: rustc_data_structures::stack::ensure_sufficient_stack
22: rustc_query_system::query::plumbing::force_query_with_job
23: rustc_query_system::query::plumbing::get_query_impl
24: ::type_of
25: rustc_typeck::check::check::check_item_type
26: rustc_middle::hir::map::Map::visit_item_likes_in_module
27: rustc_typeck::check::check::check_mod_item_types
28: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
29: rustc_data_structures::stack::ensure_sufficient_stack
30: rustc_query_system::query::plumbing::force_query_with_job
31: rustc_query_system::query::plumbing::get_query_impl
32: ::check_mod_item_types
33: rustc_session::utils::::time
34: rustc_typeck::check_crate
35: rustc_interface::passes::analysis
36: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
37: rustc_data_structures::stack::ensure_sufficient_stack
38: rustc_query_system::query::plumbing::force_query_with_job
39: rustc_query_system::query::plumbing::get_query_impl
40: ::analysis
41: rustc_interface::queries::::enter
42: rustc_span::with_source_map
43: rustc_interface::interface::create_compiler_and_run
44: scoped_tls::ScopedKey::set
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.55.0-nightly (a435b49e8 2021-06-28) running on x86_64-apple-darwin
note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `ice1::execute_transaction_fut`
#1 [type_of] computing type of `ice1::TransactionFuture::{opaque#0}`
#2 [check_mod_item_types] checking item types in module `ice1`
#3 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rust-playground`
To learn more, run the command again with --verbose.
```