From 9ea57cac0e9779ac0749ef568eeb3977fe3adacd Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Sun, 4 Oct 2020 09:26:39 +0300 Subject: Fix code style issues --- crates/hir_ty/src/diagnostics.rs | 2 +- crates/hir_ty/src/diagnostics/decl_check.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty') 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( owner: ModuleDefId, sink: &mut DiagnosticSink<'_>, ) { - let _p = profile::span("validate_body"); + let _p = profile::span("validate_module_item"); let mut validator = decl_check::DeclValidator::new(owner, sink); validator.validate_item(db); } 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 @@ //! Provides validators for the item declarations. +//! //! This includes the following items: +//! //! - variable bindings (e.g. `let x = foo();`) //! - struct fields (e.g. `struct Foo { field: u8 }`) -//! - enum fields (e.g. `enum Foo { Variant { field: u8 } }`) +//! - enum variants (e.g. `enum Foo { Variant { field: u8 } }`) //! - function/method arguments (e.g. `fn foo(arg: u8)`) +//! - constants (e.g. `const FOO: u8 = 10;`) +//! - static items (e.g. `static FOO: u8 = 10;`) +//! - match arm bindings (e.g. `foo @ Some(_)`) mod str_helpers; @@ -48,7 +53,6 @@ impl<'a, 'b> DeclValidator<'a, 'b> { } pub(super) fn validate_item(&mut self, db: &dyn HirDatabase) { - // let def = self.owner.into(); match self.owner { ModuleDefId::FunctionId(func) => self.validate_func(db, func), ModuleDefId::AdtId(adt) => self.validate_adt(db, adt), -- cgit v1.2.3