Skip to content

Unexpected type for Struct constructor: AssocTypeId #18673

Open
@lnicola

Description

@lnicola
for ()<|> 
let x = 4;
thread 'Worker' panicked at crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:403:21:
internal error: entered unreachable code: Unexpected type for `Struct` constructor: AssocTypeId(3435)<[?0 := Bool]>
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <hir_ty::diagnostics::match_check::pat_analysis::MatchCheckCtx as ra_ap_rustc_pattern_analysis::PatCx>::ctor_sub_tys
   3: ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness
   4: ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness
   5: ra_ap_rustc_pattern_analysis::usefulness::compute_match_usefulness
   6: hir_ty::diagnostics::match_check::pat_analysis::MatchCheckCtx::compute_match_usefulness
   7: hir_ty::diagnostics::expr::BodyValidationDiagnostic::collect
   8: hir::DefWithBody::diagnostics
   9: hir::ModuleDef::diagnostics
  10: hir::Module::diagnostics
  11: ide_diagnostics::semantic_diagnostics
  12: ide_diagnostics::full_diagnostics
  13: std::panic::catch_unwind
  14: ra_salsa::Cancelled::catch
  15: ide::Analysis::assists_with_fixes
  16: rust_analyzer::handlers::request::handle_code_action
  17: std::panic::catch_unwind
  18: core::ops::function::FnOnce::call_once{{vtable.shim}}

This is the same panic that was reported in #17031.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-patternpattern handling related thingsC-bugCategory: bugI-panic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions