Skip to content

Commit 9ea57ca

Browse files
committed
Fix code style issues
1 parent 50a147d commit 9ea57ca

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

crates/hir_ty/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn validate_module_item(
2121
owner: ModuleDefId,
2222
sink: &mut DiagnosticSink<'_>,
2323
) {
24-
let _p = profile::span("validate_body");
24+
let _p = profile::span("validate_module_item");
2525
let mut validator = decl_check::DeclValidator::new(owner, sink);
2626
validator.validate_item(db);
2727
}

crates/hir_ty/src/diagnostics/decl_check.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
//! Provides validators for the item declarations.
2+
//!
23
//! This includes the following items:
4+
//!
35
//! - variable bindings (e.g. `let x = foo();`)
46
//! - 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 } }`)
68
//! - 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(_)`)
712
813
mod str_helpers;
914

@@ -48,7 +53,6 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
4853
}
4954

5055
pub(super) fn validate_item(&mut self, db: &dyn HirDatabase) {
51-
// let def = self.owner.into();
5256
match self.owner {
5357
ModuleDefId::FunctionId(func) => self.validate_func(db, func),
5458
ModuleDefId::AdtId(adt) => self.validate_adt(db, adt),

crates/ide/src/diagnostics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ fn diagnostic_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabas
135135

136136
fn warning_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabase>) -> Diagnostic {
137137
Diagnostic {
138-
// name: Some(d.name().into()),
139138
range: sema.diagnostics_display_range(d).range,
140139
message: d.message(),
141140
severity: Severity::WeakWarning,

0 commit comments

Comments
 (0)