Skip to content

Couldn't compile project due to internal compiler error #109389

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

Closed
jamirhan opened this issue Mar 20, 2023 · 3 comments
Closed

Couldn't compile project due to internal compiler error #109389

jamirhan opened this issue Mar 20, 2023 · 3 comments
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

@jamirhan
Copy link

Code

use std::str::CharIndices;

pub fn longest_common_prefix(strs: Vec<&str>) -> String {
    let mut cur: Vec<_> = strs.iter().map(|str| str.char_indices()).collect();
    let res = String::new();
    let mut additional_iter = strs[0].char_indices();
    let mut cur_char = additional_iter.next();
    while let Some(ch) = cur_char {
        cur_char = additional_iter.next();
        if cur.iter().all(|iter: &mut CharIndices| iter.next() == cur_char) {
            res.push(ch);
        }
    }

    res
}

Meta

rustc --version --verbose:

rustc 1.68.0 (2c8cc3432 2023-03-06) (built from a source tarball)
binary: rustc
commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74
commit-date: 2023-03-06
host: aarch64-apple-darwin
release: 1.68.0
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:8 ~ prefix[b2cc]::longest_common_prefix::'_#1), '_) }) <= '_#29r

error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:10 ~ prefix[4f7d]::longest_common_prefix::'_#1), '_) }) <= '_#29r

thread 'rustc' panicked at 'Box<dyn Any>', /private/tmp/rust-20230310-12370-k2npmw/rustc-1.68.0-src/compiler/rustc_errors/src/lib.rs:987:33
Backtrace

stack backtrace:
thread 'rustc' panicked at 'Box<dyn Any>', /private/tmp/rust-20230310-12370-k2npmw/rustc-1.68.0-src/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:        0x10373bd1c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5c2d00a9fd17401b
   0:        0x104eb3d1c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5c2d00a9fd17401b
   1:        0x10379fbd8 - core::fmt::write::h973884ba3c2fbeab
   1:        0x104f17bd8 - core::fmt::write::h973884ba3c2fbeab
   2:        0x10370f0f8 - std::io::Write::write_fmt::ha70d3315d1fc2f98
   2:        0x104e870f8 - std::io::Write::write_fmt::ha70d3315d1fc2f98
   3:        0x10373bb2c - std::sys_common::backtrace::print::hc756c5e2e1c3f4d6
   4:        0x10371ad00 - std::panicking::default_hook::{{closure}}::h894ee4e8e690651c
   5:        0x10371a9c4 - std::panicking::default_hook::h18398798c20e01e6
   3:        0x104eb3b2c - std::sys_common::backtrace::print::hc756c5e2e1c3f4d6
   4:        0x104e92d00 - std::panicking::default_hook::{{closure}}::h894ee4e8e690651c
   5:        0x104e929c4 - std::panicking::default_hook::h18398798c20e01e6
   6:        0x10b4526c8 - rustc_driver[3629c6c25fdd6dcd]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10371b414 - std::panicking::rust_panic_with_hook::h21a3a186685b123f
   8:        0x10e820ea0 - std[792e2c34bd87b751]::panicking::begin_panic::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>::{closure#0}
   9:        0x10e81af4c - std[792e2c34bd87b751]::sys_common::backtrace::__rust_end_short_backtrace::<std[792e2c34bd87b751]::panicking::begin_panic<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>::{closure#0}, !>
  10:        0x10eec95b0 - std[792e2c34bd87b751]::panicking::begin_panic::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>
  11:        0x10e8c863c - std[792e2c34bd87b751]::panic::panic_any::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>
  12:        0x10e8c4bb0 - <rustc_errors[e9e4b8052821d2a3]::HandlerInner>::span_bug::<rustc_span[29a6daa0545d20e3]::span_encoding::Span, &alloc[48a58e32d5b3253c]::string::String>
  13:        0x10e8c49f8 - <rustc_errors[e9e4b8052821d2a3]::Handler>::span_bug::<rustc_span[29a6daa0545d20e3]::span_encoding::Span, &alloc[48a58e32d5b3253c]::string::String>
  14:        0x10e860eac - rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}
  15:        0x10e8611a4 - rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_opt::<rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  16:        0x10e86070c - rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_context_opt::<rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_opt<rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  17:        0x10e8606c8 - rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>
  18:        0x10eec5338 - rustc_middle[3cb2430efdcc22be]::util::bug::span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>
  19:        0x10e85ba18 - <rustc_infer[c7f7d560ea04233d]::infer::region_constraints::RegionConstraintCollector>::make_subregion
  20:        0x10e855efc - <rustc_infer[c7f7d560ea04233d]::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  21:        0x10e865e54 - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::regions
  22:        0x10e87b1c0 - <rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg as rustc_middle[3cb2430efdcc22be]::ty::relate::Relate>::relate::<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>
   6:        0x10cbca6c8 - rustc_driver[3629c6c25fdd6dcd]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x104e93414 - std::panicking::rust_panic_with_hook::h21a3a186685b123f
   8:        0x10ff98ea0 - std[792e2c34bd87b751]::panicking::begin_panic::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>::{closure#0}
  23:        0x10e84a5d4 - <core[12322ebcfcd6b1bf]::result::Result<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg, rustc_middle[3cb2430efdcc22be]::ty::error::TypeError> as rustc_type_ir[3cc971a0ea365ee2]::InternIteratorElement<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg, &rustc_middle[3cb2430efdcc22be]::ty::list::List<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>::intern_with::<core[12322ebcfcd6b1bf]::iter::adapters::map::Map<core[12322ebcfcd6b1bf]::iter::adapters::zip::Zip<core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>, core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>, rustc_middle[3cb2430efdcc22be]::ty::relate::relate_substs<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>::{closure#0}>, <rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt>::mk_substs<core[12322ebcfcd6b1bf]::iter::adapters::map::Map<core[12322ebcfcd6b1bf]::iter::adapters::zip::Zip<core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>, core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>, rustc_middle[3cb2430efdcc22be]::ty::relate::relate_substs<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>::{closure#0}>>::{closure#0}>
   9:        0x10ff92f4c - std[792e2c34bd87b751]::sys_common::backtrace::__rust_end_short_backtrace::<std[792e2c34bd87b751]::panicking::begin_panic<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>::{closure#0}, !>
  10:        0x1106415b0 - std[792e2c34bd87b751]::panicking::begin_panic::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>
  24:        0x10e865d18 - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::relate_item_substs
  11:        0x11004063c - std[792e2c34bd87b751]::panic::panic_any::<rustc_errors[e9e4b8052821d2a3]::ExplicitBug>
  25:        0x10e86c790 - rustc_middle[3cb2430efdcc22be]::ty::relate::super_relate_tys::<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>
  12:        0x11003cbb0 - <rustc_errors[e9e4b8052821d2a3]::HandlerInner>::span_bug::<rustc_span[29a6daa0545d20e3]::span_encoding::Span, &alloc[48a58e32d5b3253c]::string::String>
  13:        0x11003c9f8 - <rustc_errors[e9e4b8052821d2a3]::Handler>::span_bug::<rustc_span[29a6daa0545d20e3]::span_encoding::Span, &alloc[48a58e32d5b3253c]::string::String>
  26:        0x10e86907c - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::tys
  14:        0x10ffd8eac - rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}
  27:        0x10e69e640 - <rustc_infer[c7f7d560ea04233d]::infer::InferCtxt>::commit_if_ok::<rustc_infer[c7f7d560ea04233d]::infer::InferOk<()>, rustc_middle[3cb2430efdcc22be]::ty::error::TypeError, <rustc_infer[c7f7d560ea04233d]::infer::at::Trace>::eq<rustc_middle[3cb2430efdcc22be]::ty::Ty>::{closure#0}>
  28:        0x10e6a6c34 - <rustc_infer[c7f7d560ea04233d]::infer::InferCtxt>::can_eq::<rustc_middle[3cb2430efdcc22be]::ty::Ty>
  29:        0x10e682c04 - rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::suggestions::hint_missing_borrow
  15:        0x10ffd91a4 - rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_opt::<rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  30:        0x10e74bc2c - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  31:        0x10e75a02c - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  16:        0x10ffd870c - rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_context_opt::<rustc_middle[3cb2430efdcc22be]::ty::context::tls::with_opt<rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt<rustc_span[29a6daa0545d20e3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  17:        0x10ffd86c8 - rustc_middle[3cb2430efdcc22be]::util::bug::opt_span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>
  32:        0x10e763600 - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  18:        0x11063d338 - rustc_middle[3cb2430efdcc22be]::util::bug::span_bug_fmt::<rustc_span[29a6daa0545d20e3]::span_encoding::Span>
  33:        0x10e754b34 - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  19:        0x10ffd3a18 - <rustc_infer[c7f7d560ea04233d]::infer::region_constraints::RegionConstraintCollector>::make_subregion
  34:        0x10ce625f0 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_argument_types
  35:        0x10ce61bf8 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_method_argument_types
  20:        0x10ffcdefc - <rustc_infer[c7f7d560ea04233d]::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  36:        0x10cea1278 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  21:        0x10ffdde54 - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::regions
  37:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  22:        0x10fff31c0 - <rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg as rustc_middle[3cb2430efdcc22be]::ty::relate::Relate>::relate::<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>
  38:        0x10ce68ad0 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_stmt
  39:        0x10ce69058 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  40:        0x10ce9c5cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  41:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42:        0x10ce9f218 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  43:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:        0x10ce69090 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  45:        0x10ce9c5cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  46:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  47:        0x10ce9f218 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  48:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  49:        0x10ce69090 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  50:        0x10ce9e3bc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  51:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  52:        0x10ce6899c - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_stmt
  23:        0x10ffc25d4 - <core[12322ebcfcd6b1bf]::result::Result<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg, rustc_middle[3cb2430efdcc22be]::ty::error::TypeError> as rustc_type_ir[3cc971a0ea365ee2]::InternIteratorElement<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg, &rustc_middle[3cb2430efdcc22be]::ty::list::List<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>::intern_with::<core[12322ebcfcd6b1bf]::iter::adapters::map::Map<core[12322ebcfcd6b1bf]::iter::adapters::zip::Zip<core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>, core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>, rustc_middle[3cb2430efdcc22be]::ty::relate::relate_substs<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>::{closure#0}>, <rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt>::mk_substs<core[12322ebcfcd6b1bf]::iter::adapters::map::Map<core[12322ebcfcd6b1bf]::iter::adapters::zip::Zip<core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>, core[12322ebcfcd6b1bf]::iter::adapters::copied::Copied<core[12322ebcfcd6b1bf]::slice::iter::Iter<rustc_middle[3cb2430efdcc22be]::ty::subst::GenericArg>>>, rustc_middle[3cb2430efdcc22be]::ty::relate::relate_substs<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>::{closure#0}>>::{closure#0}>
  53:        0x10ce69058 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  54:        0x10ce9c5cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  24:        0x10ffddd18 - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::relate_item_substs
  55:        0x10ce55b40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:        0x10ffe4790 - rustc_middle[3cb2430efdcc22be]::ty::relate::super_relate_tys::<rustc_infer[c7f7d560ea04233d]::infer::equate::Equate>
  56:        0x10ce56e20 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_return_expr
  57:        0x10cef8d04 - rustc_hir_typeck[7683c35bc9e02d00]::check::check_fn
  58:        0x10cf266c0 - rustc_hir_typeck[7683c35bc9e02d00]::typeck
  26:        0x10ffe107c - <rustc_infer[c7f7d560ea04233d]::infer::equate::Equate as rustc_middle[3cb2430efdcc22be]::ty::relate::TypeRelation>::tys
  59:        0x10de14df8 - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, rustc_span[29a6daa0545d20e3]::def_id::LocalDefId, &rustc_middle[3cb2430efdcc22be]::ty::typeck_results::TypeckResults>
  27:        0x10fe16640 - <rustc_infer[c7f7d560ea04233d]::infer::InferCtxt>::commit_if_ok::<rustc_infer[c7f7d560ea04233d]::infer::InferOk<()>, rustc_middle[3cb2430efdcc22be]::ty::error::TypeError, <rustc_infer[c7f7d560ea04233d]::infer::at::Trace>::eq<rustc_middle[3cb2430efdcc22be]::ty::Ty>::{closure#0}>
  60:        0x10dc6217c - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::typeck, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  61:        0x10dd59d24 - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::typeck
  28:        0x10fe1ec34 - <rustc_infer[c7f7d560ea04233d]::infer::InferCtxt>::can_eq::<rustc_middle[3cb2430efdcc22be]::ty::Ty>
  29:        0x10fdfac04 - rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::suggestions::hint_missing_borrow
  62:        0x10ceed9c0 - rustc_data_structures[dc560a0b6184a92b]::sync::par_for_each_in::<&[rustc_span[29a6daa0545d20e3]::def_id::LocalDefId], <rustc_middle[3cb2430efdcc22be]::hir::map::Map>::par_body_owners<rustc_hir_typeck[7683c35bc9e02d00]::typeck_item_bodies::{closure#0}>::{closure#0}>
  30:        0x10fec3c2c - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  63:        0x10cf2495c - rustc_hir_typeck[7683c35bc9e02d00]::typeck_item_bodies
  31:        0x10fed202c - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  64:        0x10de42b04 - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, (), ()>
  32:        0x10fedb600 - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  65:        0x10dbf162c - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::typeck_item_bodies, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  33:        0x10feccb34 - <rustc_infer[c7f7d560ea04233d]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[48a3646723ea6acb]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  34:        0x10e5da5f0 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_argument_types
  66:        0x10dd59c1c - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::typeck_item_bodies
  35:        0x10e5d9bf8 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_method_argument_types
  36:        0x10e619278 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  67:        0x10d071090 - <rustc_session[adc24687b70f9861]::session::Session>::time::<(), rustc_hir_analysis[27c730d79074757c]::check_crate::{closure#7}>
  37:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  68:        0x10d0286d0 - rustc_hir_analysis[27c730d79074757c]::check_crate
  69:        0x10b4f0bbc - rustc_interface[2ddc92ac9f1917ba]::passes::analysis
  38:        0x10e5e0ad0 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_stmt
  39:        0x10e5e1058 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  40:        0x10e6145cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  70:        0x10de39f5c - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, (), core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  71:        0x10dc646a4 - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::analysis, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  41:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  72:        0x10dd56ebc - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::analysis
  42:        0x10e617218 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  73:        0x10b3f28f0 - <rustc_interface[2ddc92ac9f1917ba]::passes::QueryContext>::enter::<rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  43:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:        0x10e5e1090 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  45:        0x10e6145cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  74:        0x10b44383c - <rustc_interface[2ddc92ac9f1917ba]::queries::QueryResult<rustc_interface[2ddc92ac9f1917ba]::passes::QueryContext>>::enter::<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}::{closure#2}>
  46:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  47:        0x10e617218 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  48:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  75:        0x10b42a380 - <rustc_interface[2ddc92ac9f1917ba]::interface::Compiler>::enter::<rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}, core[12322ebcfcd6b1bf]::result::Result<core[12322ebcfcd6b1bf]::option::Option<rustc_interface[2ddc92ac9f1917ba]::queries::Linker>, rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  49:        0x10e5e1090 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  50:        0x10e6163bc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  51:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  52:        0x10e5e099c - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_stmt
  53:        0x10e5e1058 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_block_with_expected
  54:        0x10e6145cc - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_kind
  55:        0x10e5cdb40 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  56:        0x10e5cee20 - <rustc_hir_typeck[7683c35bc9e02d00]::fn_ctxt::FnCtxt>::check_return_expr
  57:        0x10e670d04 - rustc_hir_typeck[7683c35bc9e02d00]::check::check_fn
  76:        0x10b442ff4 - rustc_span[29a6daa0545d20e3]::with_source_map::<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  58:        0x10e69e6c0 - rustc_hir_typeck[7683c35bc9e02d00]::typeck
  77:        0x10b3f8614 - std[792e2c34bd87b751]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2ddc92ac9f1917ba]::util::run_in_thread_pool_with_globals<rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  59:        0x10f58cdf8 - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, rustc_span[29a6daa0545d20e3]::def_id::LocalDefId, &rustc_middle[3cb2430efdcc22be]::ty::typeck_results::TypeckResults>
  60:        0x10f3da17c - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::typeck, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  61:        0x10f4d1d24 - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::typeck
  62:        0x10e6659c0 - rustc_data_structures[dc560a0b6184a92b]::sync::par_for_each_in::<&[rustc_span[29a6daa0545d20e3]::def_id::LocalDefId], <rustc_middle[3cb2430efdcc22be]::hir::map::Map>::par_body_owners<rustc_hir_typeck[7683c35bc9e02d00]::typeck_item_bodies::{closure#0}>::{closure#0}>
  63:        0x10e69c95c - rustc_hir_typeck[7683c35bc9e02d00]::typeck_item_bodies
  78:        0x10b3db258 - <<std[792e2c34bd87b751]::thread::Builder>::spawn_unchecked_<rustc_interface[2ddc92ac9f1917ba]::util::run_in_thread_pool_with_globals<rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#1} as core[12322ebcfcd6b1bf]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  79:        0x103704df8 - std::sys::unix::thread::Thread::new::thread_start::h052506c3d46c9d54
  64:        0x10f5bab04 - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, (), ()>
  65:        0x10f36962c - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::typeck_item_bodies, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  66:        0x10f4d1c1c - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::typeck_item_bodies
  67:        0x10e7e9090 - <rustc_session[adc24687b70f9861]::session::Session>::time::<(), rustc_hir_analysis[27c730d79074757c]::check_crate::{closure#7}>
  68:        0x10e7a06d0 - rustc_hir_analysis[27c730d79074757c]::check_crate
  69:        0x10cc68bbc - rustc_interface[2ddc92ac9f1917ba]::passes::analysis
  70:        0x10f5b1f5c - <rustc_query_system[3ddf988186832f6f]::dep_graph::graph::DepGraph<rustc_middle[3cb2430efdcc22be]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3cb2430efdcc22be]::ty::context::TyCtxt, (), core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  71:        0x10f3dc6a4 - rustc_query_system[3ddf988186832f6f]::query::plumbing::try_execute_query::<rustc_query_impl[e07b316c3c721b06]::queries::analysis, rustc_query_impl[e07b316c3c721b06]::plumbing::QueryCtxt>
  72:        0x10f4ceebc - <rustc_query_impl[e07b316c3c721b06]::Queries as rustc_middle[3cb2430efdcc22be]::ty::query::QueryEngine>::analysis
  73:        0x10cb6a8f0 - <rustc_interface[2ddc92ac9f1917ba]::passes::QueryContext>::enter::<rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  74:        0x10cbbb83c - <rustc_interface[2ddc92ac9f1917ba]::queries::QueryResult<rustc_interface[2ddc92ac9f1917ba]::passes::QueryContext>>::enter::<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}::{closure#2}>
  75:        0x10cba2380 - <rustc_interface[2ddc92ac9f1917ba]::interface::Compiler>::enter::<rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}::{closure#2}, core[12322ebcfcd6b1bf]::result::Result<core[12322ebcfcd6b1bf]::option::Option<rustc_interface[2ddc92ac9f1917ba]::queries::Linker>, rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  76:        0x10cbbaff4 - rustc_span[29a6daa0545d20e3]::with_source_map::<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  77:        0x10cb70614 - std[792e2c34bd87b751]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2ddc92ac9f1917ba]::util::run_in_thread_pool_with_globals<rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>
  78:        0x10cb53258 - <<std[792e2c34bd87b751]::thread::Builder>::spawn_unchecked_<rustc_interface[2ddc92ac9f1917ba]::util::run_in_thread_pool_with_globals<rustc_interface[2ddc92ac9f1917ba]::interface::run_compiler<core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>, rustc_driver[3629c6c25fdd6dcd]::run_compiler::{closure#1}>::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[12322ebcfcd6b1bf]::result::Result<(), rustc_errors[e9e4b8052821d2a3]::ErrorGuaranteed>>::{closure#1} as core[12322ebcfcd6b1bf]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  79:        0x104e7cdf8 - std::sys::unix::thread::Thread::new::thread_start::h052506c3d46c9d54
  80:        0x1a3be9240 - __pthread_deallocate
  80:        0x1a3be9240 - __pthread_deallocate


note: the compiler unexpectedly panicked. this is a bug.
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.68.0 (2c8cc3432 2023-03-06) (built from a source tarball) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]
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: some of the compiler flags provided by cargo are hidden

note: rustc 1.68.0 (2c8cc3432 2023-03-06) (built from a source tarball) running on aarch64-apple-darwin


query stack during panic:
note: compiler flags: --crate-type lib -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 [typeck] type-checking `longest_common_prefix`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
#0 [typeck] type-checking `longest_common_prefix`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
end of query stack
error: could not compile `prefix`
warning: build failed, waiting for other jobs to finish...
error: could not compile `prefix`

@jamirhan jamirhan 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 Mar 20, 2023
@langston-barrett
Copy link
Contributor

I can reproduce on rustc 1.68 but not on nightly:

rustc 1.70.0-nightly (13afbdaa0 2023-03-17)
binary: rustc
commit-hash: 13afbdaa0655dda23d7129e59ac48f1ec88b2084
commit-date: 2023-03-17
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

@jamirhan
Copy link
Author

also works on 1.67.1

@jyn514
Copy link
Member

jyn514 commented Mar 21, 2023

Looks like a duplicate of #109339

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 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
Development

No branches or pull requests

3 participants