diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-18 17:40:12 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-18 17:40:12 +0100 |
commit | aa2def023e6b0aa8a68f4992423f566d435e55c6 (patch) | |
tree | 769fbd88c0845367795e1273333245d2cadfc475 /crates/hir_def/src | |
parent | f7a8ce35256e6a79dbe641787007e18a74e52b16 (diff) | |
parent | 8146669542dfc887956901b54a453c9a97fee7e3 (diff) |
Merge #5804
5804: Add type safety to diagnostic codes
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/diagnostics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/diagnostics.rs b/crates/hir_def/src/diagnostics.rs index c7723de00..3e19d9117 100644 --- a/crates/hir_def/src/diagnostics.rs +++ b/crates/hir_def/src/diagnostics.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::any::Any; | 3 | use std::any::Any; |
4 | 4 | ||
5 | use hir_expand::diagnostics::Diagnostic; | 5 | use hir_expand::diagnostics::{Diagnostic, DiagnosticCode}; |
6 | use syntax::{ast, AstPtr, SyntaxNodePtr}; | 6 | use syntax::{ast, AstPtr, SyntaxNodePtr}; |
7 | 7 | ||
8 | use hir_expand::{HirFileId, InFile}; | 8 | use hir_expand::{HirFileId, InFile}; |
@@ -15,8 +15,8 @@ pub struct UnresolvedModule { | |||
15 | } | 15 | } |
16 | 16 | ||
17 | impl Diagnostic for UnresolvedModule { | 17 | impl Diagnostic for UnresolvedModule { |
18 | fn name(&self) -> &'static str { | 18 | fn code(&self) -> DiagnosticCode { |
19 | "unresolved-module" | 19 | DiagnosticCode("unresolved-module") |
20 | } | 20 | } |
21 | fn message(&self) -> String { | 21 | fn message(&self) -> String { |
22 | "unresolved module".to_string() | 22 | "unresolved module".to_string() |