From e480d81988fc0c0e4f80f1c54058b95b9aaf1ebf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 1 Apr 2021 21:04:02 +0200 Subject: Introduce `GenericArg` like in Chalk Plus some more adaptations to Substitution. Lots of `assert_ty_ref` that we should revisit when introducing lifetime/const parameters. --- crates/hir_ty/src/diagnostics/match_check.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/hir_ty/src/diagnostics/match_check.rs') diff --git a/crates/hir_ty/src/diagnostics/match_check.rs b/crates/hir_ty/src/diagnostics/match_check.rs index 9cb472b51..85ba58c44 100644 --- a/crates/hir_ty/src/diagnostics/match_check.rs +++ b/crates/hir_ty/src/diagnostics/match_check.rs @@ -792,7 +792,10 @@ fn pat_constructor(cx: &MatchCheckCtx, pat: PatIdOrWild) -> MatchCheckResult { let pat_id = pat.as_id().expect("we already know this pattern is not a wild"); Some(Constructor::Tuple { - arity: cx.infer.type_of_pat[pat_id].as_tuple().ok_or(MatchCheckErr::Unknown)?.len(), + arity: cx.infer.type_of_pat[pat_id] + .as_tuple() + .ok_or(MatchCheckErr::Unknown)? + .len(&Interner), }) } Pat::Lit(lit_expr) => match cx.body.exprs[lit_expr] { -- cgit v1.2.3