diff options
author | Aleksey Kladov <[email protected]> | 2021-06-13 18:06:25 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-13 18:06:25 +0100 |
commit | 8d391ec981562785ec92ce3afe950972c523f925 (patch) | |
tree | 7729eb4ae1ef7a4cf0e0be42dfc2ef36c65cec1e /crates/hir/src/lib.rs | |
parent | bccf77f26cd504de14f7d7d03f9f2a85d0fabb3d (diff) |
internal: refactor mismatched args count diagnostic
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r-- | crates/hir/src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 16f862707..c1af5f097 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1176,12 +1176,9 @@ impl Function { | |||
1176 | } | 1176 | } |
1177 | BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => { | 1177 | BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => { |
1178 | match source_map.expr_syntax(call_expr) { | 1178 | match source_map.expr_syntax(call_expr) { |
1179 | Ok(source_ptr) => sink.push(MismatchedArgCount { | 1179 | Ok(source_ptr) => acc.push( |
1180 | file: source_ptr.file_id, | 1180 | MismatchedArgCount { call_expr: source_ptr, expected, found }.into(), |
1181 | call_expr: source_ptr.value, | 1181 | ), |
1182 | expected, | ||
1183 | found, | ||
1184 | }), | ||
1185 | Err(SyntheticSyntax) => (), | 1182 | Err(SyntheticSyntax) => (), |
1186 | } | 1183 | } |
1187 | } | 1184 | } |