Closed as not planned
Description
Code
use std::collections::HashSet;
fn calc_edges<'a>(stages: Vec<Stage<'a>>) {
stages
.into_iter()
.map(|stage: &Stage| -> Vec<Edge> {
stage
.next_stages
.into_iter()
.enumerate()
.map(|(index, next_stage)| {
let next_stage_vertex_index = stages
.into_iter()
.position(|stage| stage.identifier == next_stage.identifier);
(index, next_stage_vertex_index)
})
.collect::<Vec<Edge>>()
})
.flatten()
.collect()
}
struct Stage<'a> {
identifier: String,
next_stages: HashSet<&'a Stage<'a>>,
}
type Edge = (usize, Option<usize>);
Meta
rustc --version --verbose
:
rustc 1.68.1 (8460ca823 2023-03-20)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-pc-windows-msvc
release: 1.68.1
LLVM version: 15.0.6
Error output
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8460ca823e8367a30dda430efda790588b8c84d3\compiler\rustc_errors\src\lib.rs:987:33
Backtrace
stack backtrace:
0: 0x7ffc1c829d02 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h24420960574ebc1c
1: 0x7ffc1c86570b - core::fmt::write::h26edb44d1c5a6228
2: 0x7ffc1c81cdfa - <std::io::IoSlice as core::fmt::Debug>::fmt::h3ff7218cf0d77c3d
3: 0x7ffc1c829a4b - std::sys::common::alloc::realloc_fallback::hc95eb280a5e906e1
4: 0x7ffc1c82d3f9 - std::panicking::default_hook::h0e3996dde5e60121
5: 0x7ffc1c82d07b - std::panicking::default_hook::h0e3996dde5e60121
6: 0x7ffc0ca368d5 - rustc_driver[9a81db59c34cf3a5]::describe_lints
7: 0x7ffc1c82dd5f - std::panicking::rust_panic_with_hook::hf3035ce96f91938a
8: 0x7ffc0ecf6493 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
9: 0x7ffc0ecf49a9 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
10: 0x7ffc0ecf4619 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
11: 0x7ffc0ecf4609 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
12: 0x7ffc0ecf3fb0 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
13: 0x7ffc0ecf3e09 - <<rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt>::construct_generic_bound_failure::SubOrigin as core[88a2d7387c40f712]::fmt::Debug>::fmt
14: 0x7ffc0ecfc259 - <rustc_infer[4a5594bed6e23f7a]::infer::opaque_types::table::OpaqueTypeStorage as core[88a2d7387c40f712]::fmt::Debug>::fmt
15: 0x7ffc0ecfc2bd - <rustc_infer[4a5594bed6e23f7a]::infer::opaque_types::table::OpaqueTypeStorage as core[88a2d7387c40f712]::fmt::Debug>::fmt
16: 0x7ffc0ecfb47a - <rustc_infer[4a5594bed6e23f7a]::infer::opaque_types::table::OpaqueTypeStorage as core[88a2d7387c40f712]::fmt::Debug>::fmt
17: 0x7ffc0ecfb408 - <rustc_infer[4a5594bed6e23f7a]::infer::opaque_types::table::OpaqueTypeStorage as core[88a2d7387c40f712]::fmt::Debug>::fmt
18: 0x7ffc0ecfb3c6 - <rustc_infer[4a5594bed6e23f7a]::infer::opaque_types::table::OpaqueTypeStorage as core[88a2d7387c40f712]::fmt::Debug>::fmt
19: 0x7ffc0c864d1a - <rustc_infer[4a5594bed6e23f7a]::infer::combine::ConstInferUnifier as rustc_middle[348c050efaf3cf62]::ty::relate::TypeRelation>::consts
20: 0x7ffc0c873abf - <rustc_middle[348c050efaf3cf62]::ty::sty::AliasTy as rustc_infer[4a5594bed6e23f7a]::infer::at::ToTrace>::to_trace
21: 0x7ffc0c82ee99 - <rustc_infer[4a5594bed6e23f7a]::infer::equate::Equate as rustc_middle[348c050efaf3cf62]::ty::relate::TypeRelation>::tys
22: 0x7ffc0afff4ea - rustc_trait_selection[ba7b18a923262ca4]::traits::const_evaluatable::is_const_evaluatable
23: 0x7ffc0afec83b - <rustc_trait_selection[ba7b18a923262ca4]::traits::project::AssocTypeNormalizer as rustc_middle[348c050efaf3cf62]::ty::fold::TypeFolder>::fold_const
24: 0x7ffc0ec44e58 - <rustc_trait_selection[ba7b18a923262ca4]::traits::const_evaluatable::satisfied_from_param_env::Visitor as rustc_middle[348c050efaf3cf62]::ty::visit::TypeVisitor>::visit_const
25: 0x7ffc0ebe3c09 - <rustc_trait_selection[ba7b18a923262ca4]::traits::error_reporting::method_chain::CollectAllMismatches as rustc_middle[348c050efaf3cf62]::ty::relate::TypeRelation>::consts
26: 0x7ffc0ec5d363 - <rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[ba7b18a923262ca4]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
27: 0x7ffc0ec7087b - <rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[ba7b18a923262ca4]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
28: 0x7ffc0ec7d4a5 - <rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[ba7b18a923262ca4]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
29: 0x7ffc0ec6d209 - <rustc_infer[4a5594bed6e23f7a]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[ba7b18a923262ca4]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
30: 0x7ffc0bb8e276 - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::demand_coerce
31: 0x7ffc0bb8802a - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::demand_coerce
32: 0x7ffc0bbca622 - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::check_struct_path
33: 0x7ffc0bb87fcf - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::demand_coerce
34: 0x7ffc0bb9d7d0 - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::demand_coerce
35: 0x7ffc0bc3bd7d - <rustc_hir_typeck[de1d69685c3524a8]::writeback::WritebackCx as rustc_hir[c9ded08e9c1a2081]::intravisit::Visitor>::visit_ty
36: 0x7ffc0bb4efcc - <rustc_hir_typeck[de1d69685c3524a8]::inherited::Inherited as core[88a2d7387c40f712]::ops::deref::Deref>::deref
37: 0x7ffc0ac1f049 - <rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheEncoder as rustc_type_ir[1f8388642b2bc09c]::codec::TyEncoder>::encode_alloc_id
38: 0x7ffc0ac85215 - <&[(rustc_middle[348c050efaf3cf62]::ty::Predicate, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
39: 0x7ffc0c40fbdd - <&[(rustc_middle[348c050efaf3cf62]::ty::Clause, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
40: 0x7ffc0c2e6da3 - <rustc_query_impl[7254303e48199d54]::Queries as rustc_middle[348c050efaf3cf62]::ty::query::QueryEngine>::as_any
41: 0x7ffc0bbf80a3 - <rustc_hir_typeck[de1d69685c3524a8]::fn_ctxt::FnCtxt>::resolve_fully_qualified_call
42: 0x7ffc0a8cbcb1 - <rustc_hir_typeck[de1d69685c3524a8]::inherited::Inherited>::build
43: 0x7ffc0ac20e1f - <rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheEncoder as rustc_type_ir[1f8388642b2bc09c]::codec::TyEncoder>::encode_alloc_id
44: 0x7ffc0aca41bf - <&[(rustc_middle[348c050efaf3cf62]::ty::Predicate, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
45: 0x7ffc0ad130d1 - <&[(rustc_middle[348c050efaf3cf62]::ty::Predicate, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
46: 0x7ffc0abf2d72 - <rustc_query_impl[7254303e48199d54]::Queries as rustc_middle[348c050efaf3cf62]::ty::query::QueryEngine>::try_mark_green
47: 0x7ffc0a92a45a - <<dyn rustc_hir_analysis[38f54a96453c487e]::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt as rustc_hir_analysis[38f54a96453c487e]::astconv::CreateSubstsForGenericArgsCtxt>::inferred_kind
48: 0x7ffc0a922149 - rustc_hir_analysis[38f54a96453c487e]::check_crate
49: 0x7ffc0a202275 - rustc_interface[80bde221feee50b9]::passes::analysis
50: 0x7ffc0ac20a4f - <rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheEncoder as rustc_type_ir[1f8388642b2bc09c]::codec::TyEncoder>::encode_alloc_id
51: 0x7ffc0ac9fe69 - <&[(rustc_middle[348c050efaf3cf62]::ty::Predicate, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
52: 0x7ffc0ad8c201 - <&[(rustc_middle[348c050efaf3cf62]::ty::Predicate, rustc_span[d3e736c3e38f3ea5]::span_encoding::Span)] as rustc_serialize[fb792d7000edb6]::serialize::Decodable<rustc_query_impl[7254303e48199d54]::on_disk_cache::CacheDecoder>>::decode
53: 0x7ffc0abf056f - <rustc_query_impl[7254303e48199d54]::Queries as rustc_middle[348c050efaf3cf62]::ty::query::QueryEngine>::try_mark_green
54: 0x7ffc0a1ad1a9 - <rustc_middle[348c050efaf3cf62]::ty::SymbolName as core[88a2d7387c40f712]::fmt::Debug>::fmt 55: 0x7ffc0a1be7ba - rustc_driver[9a81db59c34cf3a5]::args::arg_expand_all
56: 0x7ffc0a1a2ac1 - <unknown>
57: 0x7ffc0a1acacb - <rustc_middle[348c050efaf3cf62]::ty::SymbolName as core[88a2d7387c40f712]::fmt::Debug>::fmt 58: 0x7ffc0a1ac319 - <rustc_middle[348c050efaf3cf62]::ty::SymbolName as core[88a2d7387c40f712]::fmt::Debug>::fmt 59: 0x7ffc0a1a404d - <rustc_middle[348c050efaf3cf62]::ty::SymbolName as core[88a2d7387c40f712]::fmt::Debug>::fmt 60: 0x7ffc1c84021c - std::sys::windows::thread::Thread::new::hd26bc42258b98de9
61: 0x7ffcbc147614 - BaseThreadInitThunk
62: 0x7ffcbdb226a1 - RtlUserThreadStart