aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Aleksanov <[email protected]>2020-10-04 07:26:39 +0100
committerIgor Aleksanov <[email protected]>2020-10-12 09:05:00 +0100
commit9ea57cac0e9779ac0749ef568eeb3977fe3adacd (patch)
treec1a89dce0d234c6b193f3145c84779d229e27404
parent50a147dcdfd0df462f0c24e5d7bcfe60abadac32 (diff)
Fix code style issues
-rw-r--r--crates/hir_ty/src/diagnostics.rs2
-rw-r--r--crates/hir_ty/src/diagnostics/decl_check.rs8
-rw-r--r--crates/ide/src/diagnostics.rs1
3 files changed, 7 insertions, 4 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),
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs
index 8e508639b..add102ff2 100644
--- a/crates/ide/src/diagnostics.rs
+++ b/crates/ide/src/diagnostics.rs
@@ -135,7 +135,6 @@ fn diagnostic_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabas
135 135
136fn warning_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabase>) -> Diagnostic { 136fn warning_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabase>) -> Diagnostic {
137 Diagnostic { 137 Diagnostic {
138 // name: Some(d.name().into()),
139 range: sema.diagnostics_display_range(d).range, 138 range: sema.diagnostics_display_range(d).range,
140 message: d.message(), 139 message: d.message(),
141 severity: Severity::WeakWarning, 140 severity: Severity::WeakWarning,