diff options
author | Aleksey Kladov <[email protected]> | 2019-03-23 15:35:14 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-03-25 07:52:50 +0000 |
commit | 3fb88e95aa5e122a521beec766d5b1264ca4de3b (patch) | |
tree | 17e5815f78f81f04fd462605288e09e82c8caee8 /crates/ra_hir/src/ty | |
parent | fcca35969dd7c63a83ee34c4ce7d54cefdb72bbe (diff) |
switch modules to new diagnostics
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 02708ba0f..6dc3edc7a 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -120,9 +120,9 @@ impl InferenceResult { | |||
120 | &self, | 120 | &self, |
121 | db: &impl HirDatabase, | 121 | db: &impl HirDatabase, |
122 | owner: Function, | 122 | owner: Function, |
123 | diagnostics: &mut Diagnostics, | 123 | sink: &mut Diagnostics, |
124 | ) { | 124 | ) { |
125 | self.diagnostics.iter().for_each(|it| it.add_to(db, owner, diagnostics)) | 125 | self.diagnostics.iter().for_each(|it| it.add_to(db, owner, sink)) |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
@@ -1277,12 +1277,17 @@ mod diagnostics { | |||
1277 | } | 1277 | } |
1278 | 1278 | ||
1279 | impl InferenceDiagnostic { | 1279 | impl InferenceDiagnostic { |
1280 | pub(super) fn add_to(&self, db: &impl HirDatabase, owner: Function, acc: &mut Diagnostics) { | 1280 | pub(super) fn add_to( |
1281 | &self, | ||
1282 | db: &impl HirDatabase, | ||
1283 | owner: Function, | ||
1284 | sink: &mut Diagnostics, | ||
1285 | ) { | ||
1281 | match self { | 1286 | match self { |
1282 | InferenceDiagnostic::NoSuchField { expr, field } => { | 1287 | InferenceDiagnostic::NoSuchField { expr, field } => { |
1283 | let (file, _) = owner.source(db); | 1288 | let (file, _) = owner.source(db); |
1284 | let field = owner.body_source_map(db).field_syntax(*expr, *field); | 1289 | let field = owner.body_source_map(db).field_syntax(*expr, *field); |
1285 | acc.push(NoSuchField { file, field }) | 1290 | sink.push(NoSuchField { file, field }) |
1286 | } | 1291 | } |
1287 | } | 1292 | } |
1288 | } | 1293 | } |