aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty')
-rw-r--r--crates/hir_ty/src/diagnostics.rs2
-rw-r--r--crates/hir_ty/src/diagnostics/decl_check.rs8
2 files changed, 7 insertions, 3 deletions
diff --git a/crates/hir_ty/src/diagnostics.rs b/crates/hir_ty/src/diagnostics.rs
index 40f8c8ba2..f2e06495e 100644
--- a/crates/hir_ty/src/diagnostics.rs
+++ b/crates/hir_ty/src/diagnostics.rs
@@ -21,7 +21,7 @@ pub fn validate_module_item(
21 owner: ModuleDefId, 21 owner: ModuleDefId,
22 sink: &mut DiagnosticSink<'_>, 22 sink: &mut DiagnosticSink<'_>,
23) { 23) {
24 let _p = profile::span("validate_body"); 24 let _p = profile::span("validate_module_item");
25 let mut validator = decl_check::DeclValidator::new(owner, sink); 25 let mut validator = decl_check::DeclValidator::new(owner, sink);
26 validator.validate_item(db); 26 validator.validate_item(db);
27} 27}
diff --git a/crates/hir_ty/src/diagnostics/decl_check.rs b/crates/hir_ty/src/diagnostics/decl_check.rs
index 28ce15773..4c20921e5 100644
--- a/crates/hir_ty/src/diagnostics/decl_check.rs
+++ b/crates/hir_ty/src/diagnostics/decl_check.rs
@@ -1,9 +1,14 @@
1//! Provides validators for the item declarations. 1//! Provides validators for the item declarations.
2//!
2//! This includes the following items: 3//! This includes the following items:
4//!
3//! - variable bindings (e.g. `let x = foo();`) 5//! - variable bindings (e.g. `let x = foo();`)
4//! - struct fields (e.g. `struct Foo { field: u8 }`) 6//! - struct fields (e.g. `struct Foo { field: u8 }`)
5//! - enum fields (e.g. `enum Foo { Variant { field: u8 } }`) 7//! - enum variants (e.g. `enum Foo { Variant { field: u8 } }`)
6//! - function/method arguments (e.g. `fn foo(arg: u8)`) 8//! - function/method arguments (e.g. `fn foo(arg: u8)`)
9//! - constants (e.g. `const FOO: u8 = 10;`)
10//! - static items (e.g. `static FOO: u8 = 10;`)
11//! - match arm bindings (e.g. `foo @ Some(_)`)
7 12
8mod str_helpers; 13mod str_helpers;
9 14
@@ -48,7 +53,6 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
48 } 53 }
49 54
50 pub(super) fn validate_item(&mut self, db: &dyn HirDatabase) { 55 pub(super) fn validate_item(&mut self, db: &dyn HirDatabase) {
51 // let def = self.owner.into();
52 match self.owner { 56 match self.owner {
53 ModuleDefId::FunctionId(func) => self.validate_func(db, func), 57 ModuleDefId::FunctionId(func) => self.validate_func(db, func),
54 ModuleDefId::AdtId(adt) => self.validate_adt(db, adt), 58 ModuleDefId::AdtId(adt) => self.validate_adt(db, adt),