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

Future in trait_alias causes internal compiler error ? #104719

Closed
kanarus opened this issue Nov 22, 2022 · 0 comments · Fixed by #107614
Closed

Future in trait_alias causes internal compiler error ? #104719

kanarus opened this issue Nov 22, 2022 · 0 comments · Fixed by #107614
Assignees
Labels
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.

Comments

@kanarus
Copy link

kanarus commented Nov 22, 2022

Code

#![feature(trait_alias)]
use futures::Future;

trait F<Fut: Future<Output = usize>> = Fn() -> Fut;
fn f<Fut>(a: dyn F<Fut>) {}

fn main() {}

Meta

  • rustc --version --verbose:
rustc 1.67.0-nightly (1286ee23e 2022-11-05)
binary: rustc
commit-hash: 1286ee23e4e2dec8c1696d3d76c6b26d97bbcf82
commit-date: 2022-11-05
host: aarch64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4
  • Moving <Fut: Future<Output = usize>> to where-clause (e.g. where Fut: Future<Output = usize>) doesn't change the result
  • Some part of code analyzing of rust-analyzer seems to stop at dyn F<Fut>. For example, when we add some "plausible" arguments like b: F, c: Fn after a: dyn F<Fut>, rust-analyzer doesn't report any mistakes.
  • When replacing Future<Output = usize> with non-Future trait like ToString, everything get fine:
    • rust-analyzer reports "the size for values of type (dyn Fn() -> Fut + 'static) cannot be known at compilation time" caused by rustc
    • and adding & to dyn F<Fut> makes it compilable

Error output

cargo build:

   Compiling x v0.1.0 (/Users/kanarus/Projects/experiment-of-cargo)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Fut`,
 right: `FreshTy(0)`', compiler/rustc_hir_analysis/src/astconv/mod.rs:1510:17
stack backtrace:
   0:        0x104a37d00 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::haf3883fade86d22d
   1:        0x104a8283c - core::fmt::write::h586369edc3d621be
   2:        0x104a2a910 - std::io::Write::write_fmt::hd49c8a766dbe1256
   3:        0x104a37b14 - std::sys_common::backtrace::print::hb2a6b9b8cd29df68
   4:        0x104a3a668 - std::panicking::default_hook::{{closure}}::hbfa33fc78d6bc544
   5:        0x104a3a3c0 - std::panicking::default_hook::h3f44e70bec5b9a68
   6:        0x10c9779f4 - rustc_driver[d28aa724c6ee2406]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x104a3ad78 - std::panicking::rust_panic_with_hook::h5b5580e1021d3f8b
   8:        0x104a3ab60 - std::panicking::begin_panic_handler::{{closure}}::h35bf90c35f5bee31
   9:        0x104a38168 - std::sys_common::backtrace::__rust_end_short_backtrace::hf097075f6803994a
  10:        0x104a3a8b4 - _rust_begin_unwind
  11:        0x104aae1f8 - core::panicking::panic_fmt::h48dfe143742508dc
  12:        0x104a7fc5c - core::panicking::assert_failed_inner::h6ffba988bc5fafcf
  13:        0x110ae5e50 - core[d1f3415165dba3f6]::panicking::assert_failed::<rustc_middle[d0475add3887dfd3]::ty::Ty, rustc_middle[d0475add3887dfd3]::ty::Ty>
  14:        0x10ee71038 - <rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::ProjectionPredicate>>::map_bound::<<dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}::{closure#0}, rustc_middle[d0475add3887dfd3]::ty::sty::ExistentialProjection>
  15:        0x10ee6a21c - <core[d1f3415165dba3f6]::iter::adapters::chain::Chain<core[d1f3415165dba3f6]::iter::adapters::chain::Chain<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::slice::iter::Iter<rustc_trait_selection[f4ea8686592e16cc]::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#12}>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#14}>, core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::slice::iter::Iter<(rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::ProjectionPredicate>, rustc_span[36d9a4cdbe26759f]::span_encoding::Span)>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#16}>>, core[d1f3415165dba3f6]::iter::adapters::map::Map<alloc[65e608ada264bb2d]::vec::into_iter::IntoIter<rustc_trait_selection[f4ea8686592e16cc]::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#15}>> as core[d1f3415165dba3f6]::iter::traits::iterator::Iterator>::next
  16:        0x10ee62424 - <smallvec[87ab3001f96c7bc7]::SmallVec<[rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::sty::ExistentialPredicate>; 8usize]> as core[d1f3415165dba3f6]::iter::traits::collect::Extend<rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::sty::ExistentialPredicate>>>::extend::<core[d1f3415165dba3f6]::iter::adapters::chain::Chain<core[d1f3415165dba3f6]::iter::adapters::chain::Chain<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::slice::iter::Iter<rustc_trait_selection[f4ea8686592e16cc]::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#12}>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#14}>, core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::slice::iter::Iter<(rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::ProjectionPredicate>, rustc_span[36d9a4cdbe26759f]::span_encoding::Span)>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#16}>>, core[d1f3415165dba3f6]::iter::adapters::map::Map<alloc[65e608ada264bb2d]::vec::into_iter::IntoIter<rustc_trait_selection[f4ea8686592e16cc]::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#15}>>>
  17:        0x10ef2da88 - <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::conv_object_ty_poly_trait_ref
  18:        0x10ef42168 - <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  19:        0x10eede5b4 - <core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::enumerate::Enumerate<core[d1f3415165dba3f6]::slice::iter::Iter<rustc_hir[e9c00d8902f14da9]::hir::Ty>>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}> as core[d1f3415165dba3f6]::iter::traits::iterator::Iterator>::fold::<(), core[d1f3415165dba3f6]::iter::traits::iterator::Iterator::for_each::call<rustc_middle[d0475add3887dfd3]::ty::Ty, <alloc[65e608ada264bb2d]::vec::Vec<rustc_middle[d0475add3887dfd3]::ty::Ty> as alloc[65e608ada264bb2d]::vec::spec_extend::SpecExtend<rustc_middle[d0475add3887dfd3]::ty::Ty, core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::enumerate::Enumerate<core[d1f3415165dba3f6]::slice::iter::Iter<rustc_hir[e9c00d8902f14da9]::hir::Ty>>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}>>>::spec_extend::{closure#0}>::{closure#0}>
  20:        0x10ee3ade4 - <alloc[65e608ada264bb2d]::vec::Vec<rustc_middle[d0475add3887dfd3]::ty::Ty> as alloc[65e608ada264bb2d]::vec::spec_from_iter::SpecFromIter<rustc_middle[d0475add3887dfd3]::ty::Ty, core[d1f3415165dba3f6]::iter::adapters::map::Map<core[d1f3415165dba3f6]::iter::adapters::enumerate::Enumerate<core[d1f3415165dba3f6]::slice::iter::Iter<rustc_hir[e9c00d8902f14da9]::hir::Ty>>, <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}>>>::from_iter
  21:        0x10ef424f8 - <dyn rustc_hir_analysis[9bb8dc090afd8a]::astconv::AstConv>::ty_of_fn::{closure#0}
  22:        0x10eec723c - rustc_hir_analysis[9bb8dc090afd8a]::collect::infer_return_ty_for_fn_sig
  23:        0x10eed122c - rustc_hir_analysis[9bb8dc090afd8a]::collect::fn_sig
  24:        0x10fbfa61c - <rustc_query_system[3340307952f6e132]::dep_graph::graph::DepGraph<rustc_middle[d0475add3887dfd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[d0475add3887dfd3]::ty::context::TyCtxt, rustc_span[36d9a4cdbe26759f]::def_id::DefId, rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::sty::FnSig>>
  25:        0x10f9a0288 - rustc_query_system[3340307952f6e132]::query::plumbing::try_execute_query::<rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt, rustc_query_system[3340307952f6e132]::query::caches::DefaultCache<rustc_span[36d9a4cdbe26759f]::def_id::DefId, rustc_middle[d0475add3887dfd3]::ty::sty::Binder<rustc_middle[d0475add3887dfd3]::ty::sty::FnSig>>>
  26:        0x10fa59928 - rustc_query_system[3340307952f6e132]::query::plumbing::get_query::<rustc_query_impl[fb2515e7d176a9bb]::queries::fn_sig, rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt>
  27:        0x10faeeee8 - <rustc_query_impl[fb2515e7d176a9bb]::Queries as rustc_middle[d0475add3887dfd3]::ty::query::QueryEngine>::fn_sig
  28:        0x10eec4eb4 - rustc_hir_analysis[9bb8dc090afd8a]::collect::convert_item
  29:        0x10eebeba4 - <rustc_hir_analysis[9bb8dc090afd8a]::collect::CollectItemTypesVisitor as rustc_hir[e9c00d8902f14da9]::intravisit::Visitor>::visit_item
  30:        0x10ee7a480 - <rustc_middle[d0475add3887dfd3]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[9bb8dc090afd8a]::collect::CollectItemTypesVisitor>
  31:        0x10eebe2a4 - rustc_hir_analysis[9bb8dc090afd8a]::collect::collect_mod_item_types
  32:        0x10fbf9ca4 - <rustc_query_system[3340307952f6e132]::dep_graph::graph::DepGraph<rustc_middle[d0475add3887dfd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[d0475add3887dfd3]::ty::context::TyCtxt, rustc_span[36d9a4cdbe26759f]::def_id::LocalDefId, ()>
  33:        0x10f98d144 - rustc_query_system[3340307952f6e132]::query::plumbing::try_execute_query::<rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt, rustc_query_system[3340307952f6e132]::query::caches::DefaultCache<rustc_span[36d9a4cdbe26759f]::def_id::LocalDefId, ()>>
  34:        0x10fa4d504 - rustc_query_system[3340307952f6e132]::query::plumbing::get_query::<rustc_query_impl[fb2515e7d176a9bb]::queries::collect_mod_item_types, rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt>
  35:        0x10ee79cbc - <rustc_middle[d0475add3887dfd3]::hir::map::Map>::for_each_module::<rustc_hir_analysis[9bb8dc090afd8a]::check_crate::{closure#0}::{closure#0}::{closure#0}>
  36:        0x10ee6e58c - <rustc_session[e361cb92ae51219d]::session::Session>::track_errors::<rustc_hir_analysis[9bb8dc090afd8a]::check_crate::{closure#0}, ()>
  37:        0x10ee26264 - rustc_hir_analysis[9bb8dc090afd8a]::check_crate
  38:        0x10ca917dc - rustc_interface[30e974206ea86b74]::passes::analysis
  39:        0x10fc21c68 - <rustc_query_system[3340307952f6e132]::dep_graph::graph::DepGraph<rustc_middle[d0475add3887dfd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[d0475add3887dfd3]::ty::context::TyCtxt, (), core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>
  40:        0x10f9f0c50 - rustc_query_system[3340307952f6e132]::query::plumbing::try_execute_query::<rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt, rustc_query_system[3340307952f6e132]::query::caches::DefaultCache<(), core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>>
  41:        0x10fa59ff4 - rustc_query_system[3340307952f6e132]::query::plumbing::get_query::<rustc_query_impl[fb2515e7d176a9bb]::queries::analysis, rustc_query_impl[fb2515e7d176a9bb]::plumbing::QueryCtxt>
  42:        0x10c98fd70 - <rustc_interface[30e974206ea86b74]::passes::QueryContext>::enter::<rustc_driver[d28aa724c6ee2406]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>
  43:        0x10c9cc708 - rustc_span[36d9a4cdbe26759f]::with_source_map::<core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>, rustc_interface[30e974206ea86b74]::interface::run_compiler<core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>, rustc_driver[d28aa724c6ee2406]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  44:        0x10c9be614 - <scoped_tls[a0d75c10d139911f]::ScopedKey<rustc_span[36d9a4cdbe26759f]::SessionGlobals>>::set::<rustc_interface[30e974206ea86b74]::interface::run_compiler<core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>, rustc_driver[d28aa724c6ee2406]::run_compiler::{closure#1}>::{closure#0}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>
  45:        0x10c9930fc - std[68109d43c3ebdd4c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[30e974206ea86b74]::util::run_in_thread_pool_with_globals<rustc_interface[30e974206ea86b74]::interface::run_compiler<core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>, rustc_driver[d28aa724c6ee2406]::run_compiler::{closure#1}>::{closure#0}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>
  46:        0x10c97ca20 - <<std[68109d43c3ebdd4c]::thread::Builder>::spawn_unchecked_<rustc_interface[30e974206ea86b74]::util::run_in_thread_pool_with_globals<rustc_interface[30e974206ea86b74]::interface::run_compiler<core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>, rustc_driver[d28aa724c6ee2406]::run_compiler::{closure#1}>::{closure#0}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d1f3415165dba3f6]::result::Result<(), rustc_errors[6317447bb9fda403]::ErrorGuaranteed>>::{closure#1} as core[d1f3415165dba3f6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:        0x104a42dc4 - std::sys::unix::thread::Thread::new::thread_start::h1d785310ca00b7ad
  48:        0x1a841e06c - __pthread_deallocate

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.67.0-nightly (1286ee23e 2022-11-05) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [fn_sig] computing function signature of `f`
#1 [collect_mod_item_types] collecting item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `x`
Backtrace `RUST_BACKTRACE=1 cargo build`:
   Compiling x v0.1.0 (/Users/kanarus/Projects/experiment-of-cargo)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Fut`,
 right: `FreshTy(0)`', compiler/rustc_hir_analysis/src/astconv/mod.rs:1510:17
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<rustc_middle::ty::Ty, rustc_middle::ty::Ty>
   4: <rustc_middle::ty::sty::Binder<rustc_middle::ty::ProjectionPredicate>>::map_bound::<<dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}::{closure#0}, rustc_middle::ty::sty::ExistentialProjection>
   5: <core::iter::adapters::chain::Chain<core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_trait_selection::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#12}>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#14}>, core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_middle::ty::sty::Binder<rustc_middle::ty::ProjectionPredicate>, rustc_span::span_encoding::Span)>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#16}>>, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<rustc_trait_selection::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#15}>> as core::iter::traits::iterator::Iterator>::next
   6: <smallvec::SmallVec<[rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>; 8]> as core::iter::traits::collect::Extend<rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>>>::extend::<core::iter::adapters::chain::Chain<core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_trait_selection::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#12}>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#14}>, core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_middle::ty::sty::Binder<rustc_middle::ty::ProjectionPredicate>, rustc_span::span_encoding::Span)>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#13}>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#16}>>, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<rustc_trait_selection::traits::util::TraitAliasExpansionInfo>, <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref::{closure#15}>>>
   7: <dyn rustc_hir_analysis::astconv::AstConv>::conv_object_ty_poly_trait_ref
   8: <dyn rustc_hir_analysis::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
   9: <core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Ty>>, <dyn rustc_hir_analysis::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<rustc_middle::ty::Ty, <alloc::vec::Vec<rustc_middle::ty::Ty> as alloc::vec::spec_extend::SpecExtend<rustc_middle::ty::Ty, core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Ty>>, <dyn rustc_hir_analysis::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}>>>::spec_extend::{closure#0}>::{closure#0}>
  10: <alloc::vec::Vec<rustc_middle::ty::Ty> as alloc::vec::spec_from_iter::SpecFromIter<rustc_middle::ty::Ty, core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Ty>>, <dyn rustc_hir_analysis::astconv::AstConv>::ty_of_fn::{closure#0}::{closure#0}>>>::from_iter
  11: <dyn rustc_hir_analysis::astconv::AstConv>::ty_of_fn::{closure#0}
  12: rustc_hir_analysis::collect::infer_return_ty_for_fn_sig
  13: rustc_hir_analysis::collect::fn_sig
  14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::FnSig>>
  15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::FnSig>>>
  16: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::fn_sig, rustc_query_impl::plumbing::QueryCtxt>
  17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::fn_sig
  18: rustc_hir_analysis::collect::convert_item
  19: <rustc_hir_analysis::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_item
  20: <rustc_middle::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis::collect::CollectItemTypesVisitor>
  21: rustc_hir_analysis::collect::collect_mod_item_types
  22: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, ()>
  23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, ()>>
  24: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::collect_mod_item_types, rustc_query_impl::plumbing::QueryCtxt>
  25: <rustc_middle::hir::map::Map>::for_each_module::<rustc_hir_analysis::check_crate::{closure#0}::{closure#0}::{closure#0}>
  26: <rustc_session::session::Session>::track_errors::<rustc_hir_analysis::check_crate::{closure#0}, ()>
  27: rustc_hir_analysis::check_crate
  28: rustc_interface::passes::analysis
  29: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  31: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  32: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  33: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  34: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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.67.0-nightly (1286ee23e 2022-11-05) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [fn_sig] computing function signature of `f`
#1 [collect_mod_item_types] collecting item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `x`
@kanarus kanarus 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 22, 2022
kanarus added a commit to kanarus/async_http that referenced this issue Nov 22, 2022
@compiler-errors compiler-errors self-assigned this Nov 22, 2022
@bors bors closed this as completed in 9be9b5e Apr 12, 2023
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. 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
2 participants