aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-05-31 17:09:44 +0100
committerAleksey Kladov <[email protected]>2021-05-31 17:45:50 +0100
commit159922de93bd0437093f9ca07eda4673ba285b89 (patch)
tree42feed3fe7649d45c435b055bbe7aac581cd3661 /crates/hir_ty/src
parent341f8bb200d60caf4c0ea70738198ac8d62218b8 (diff)
minor: it's Parameter, not Argument
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r--crates/hir_ty/src/diagnostics.rs4
-rw-r--r--crates/hir_ty/src/diagnostics/decl_check.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/diagnostics.rs b/crates/hir_ty/src/diagnostics.rs
index 7598e2193..283894704 100644
--- a/crates/hir_ty/src/diagnostics.rs
+++ b/crates/hir_ty/src/diagnostics.rs
@@ -349,11 +349,11 @@ impl fmt::Display for CaseType {
349 349
350#[derive(Debug)] 350#[derive(Debug)]
351pub enum IdentType { 351pub enum IdentType {
352 Argument,
353 Constant, 352 Constant,
354 Enum, 353 Enum,
355 Field, 354 Field,
356 Function, 355 Function,
356 Parameter,
357 StaticVariable, 357 StaticVariable,
358 Structure, 358 Structure,
359 Variable, 359 Variable,
@@ -363,11 +363,11 @@ pub enum IdentType {
363impl fmt::Display for IdentType { 363impl fmt::Display for IdentType {
364 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 364 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
365 let repr = match self { 365 let repr = match self {
366 IdentType::Argument => "Argument",
367 IdentType::Constant => "Constant", 366 IdentType::Constant => "Constant",
368 IdentType::Enum => "Enum", 367 IdentType::Enum => "Enum",
369 IdentType::Field => "Field", 368 IdentType::Field => "Field",
370 IdentType::Function => "Function", 369 IdentType::Function => "Function",
370 IdentType::Parameter => "Parameter",
371 IdentType::StaticVariable => "Static variable", 371 IdentType::StaticVariable => "Static variable",
372 IdentType::Structure => "Structure", 372 IdentType::Structure => "Structure",
373 IdentType::Variable => "Variable", 373 IdentType::Variable => "Variable",
diff --git a/crates/hir_ty/src/diagnostics/decl_check.rs b/crates/hir_ty/src/diagnostics/decl_check.rs
index bfa53bdce..cfb5d7320 100644
--- a/crates/hir_ty/src/diagnostics/decl_check.rs
+++ b/crates/hir_ty/src/diagnostics/decl_check.rs
@@ -256,7 +256,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
256 } 256 }
257 257
258 let ident_type = 258 let ident_type =
259 if is_param { IdentType::Argument } else { IdentType::Variable }; 259 if is_param { IdentType::Parameter } else { IdentType::Variable };
260 260
261 let diagnostic = IncorrectCase { 261 let diagnostic = IncorrectCase {
262 file: source_ptr.file_id, 262 file: source_ptr.file_id,
@@ -643,10 +643,10 @@ fn NonSnakeCaseName() {}
643 check_diagnostics( 643 check_diagnostics(
644 r#" 644 r#"
645fn foo(SomeParam: u8) {} 645fn foo(SomeParam: u8) {}
646 // ^^^^^^^^^ Argument `SomeParam` should have snake_case name, e.g. `some_param` 646 // ^^^^^^^^^ Parameter `SomeParam` should have snake_case name, e.g. `some_param`
647 647
648fn foo2(ok_param: &str, CAPS_PARAM: u8) {} 648fn foo2(ok_param: &str, CAPS_PARAM: u8) {}
649 // ^^^^^^^^^^ Argument `CAPS_PARAM` should have snake_case name, e.g. `caps_param` 649 // ^^^^^^^^^^ Parameter `CAPS_PARAM` should have snake_case name, e.g. `caps_param`
650"#, 650"#,
651 ); 651 );
652 } 652 }