Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 18de04b16d..c07c017c3d 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1183,6 +1183,19 @@ impl DefWithBody {
.expect("break outside of loop in synthetic syntax");
acc.push(BreakOutsideOfLoop { expr }.into())
}
+ hir_ty::InferenceDiagnostic::MismatchedArgCount { call_expr, expected, found } => {
+ match source_map.expr_syntax(*call_expr) {
+ Ok(source_ptr) => acc.push(
+ MismatchedArgCount {
+ call_expr: source_ptr,
+ expected: *expected,
+ found: *found,
+ }
+ .into(),
+ ),
+ Err(SyntheticSyntax) => (),
+ }
+ }
}
}
for (expr, mismatch) in infer.expr_type_mismatches() {
@@ -1297,14 +1310,6 @@ impl DefWithBody {
);
}
}
- BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => {
- match source_map.expr_syntax(call_expr) {
- Ok(source_ptr) => acc.push(
- MismatchedArgCount { call_expr: source_ptr, expected, found }.into(),
- ),
- Err(SyntheticSyntax) => (),
- }
- }
BodyValidationDiagnostic::MissingMatchArms { match_expr } => {
match source_map.expr_syntax(match_expr) {
Ok(source_ptr) => {