From bfae2634b496caa54f38f4c22d285c5fc1dad190 Mon Sep 17 00:00:00 2001 From: unexge Date: Wed, 23 Dec 2020 22:18:31 +0300 Subject: Prevent multiple incorrect case diagnostics in functions --- crates/hir/src/code_model.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 1d7e5ddd7..6d17d546a 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -374,8 +374,6 @@ impl Module { let crate_def_map = db.crate_def_map(self.id.krate); crate_def_map.add_diagnostics(db.upcast(), self.id.local_id, sink); for decl in self.declarations(db) { - decl.diagnostics(db, sink); - match decl { crate::ModuleDef::Function(f) => f.diagnostics(db, sink), crate::ModuleDef::Module(m) => { @@ -384,7 +382,9 @@ impl Module { m.diagnostics(db, sink) } } - _ => (), + _ => { + decl.diagnostics(db, sink); + } } } -- cgit v1.2.3