diff options
author | Igor Aleksanov <[email protected]> | 2020-10-04 05:39:35 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-10-12 09:05:00 +0100 |
commit | b42562b5dee4f4ce23094c7bab6406e3b00f90ad (patch) | |
tree | 8711713d749b19f22a534bb3dd1925063d1baade /crates/hir_ty/src/diagnostics.rs | |
parent | 9ec1741b651bd13e4e5e6224f2e2c5c503846a6b (diff) |
Make incorrect case diagnostic work inside of functions
Diffstat (limited to 'crates/hir_ty/src/diagnostics.rs')
-rw-r--r-- | crates/hir_ty/src/diagnostics.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir_ty/src/diagnostics.rs b/crates/hir_ty/src/diagnostics.rs index bd370e3b2..40f8c8ba2 100644 --- a/crates/hir_ty/src/diagnostics.rs +++ b/crates/hir_ty/src/diagnostics.rs | |||
@@ -281,7 +281,7 @@ impl Diagnostic for IncorrectCase { | |||
281 | 281 | ||
282 | fn message(&self) -> String { | 282 | fn message(&self) -> String { |
283 | format!( | 283 | format!( |
284 | "{} `{}` should have a {} name, e.g. `{}`", | 284 | "{} `{}` should have {} name, e.g. `{}`", |
285 | self.ident_type, | 285 | self.ident_type, |
286 | self.ident_text, | 286 | self.ident_text, |
287 | self.expected_case.to_string(), | 287 | self.expected_case.to_string(), |
@@ -339,6 +339,8 @@ mod tests { | |||
339 | let impl_data = self.impl_data(impl_id); | 339 | let impl_data = self.impl_data(impl_id); |
340 | for item in impl_data.items.iter() { | 340 | for item in impl_data.items.iter() { |
341 | if let AssocItemId::FunctionId(f) = item { | 341 | if let AssocItemId::FunctionId(f) = item { |
342 | let mut sink = DiagnosticSinkBuilder::new().build(&mut cb); | ||
343 | validate_module_item(self, ModuleDefId::FunctionId(*f), &mut sink); | ||
342 | fns.push(*f) | 344 | fns.push(*f) |
343 | } | 345 | } |
344 | } | 346 | } |