diff options
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 0b3e16ae7..56acd3bbf 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -33,8 +33,8 @@ pub struct NoSuchField { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | impl Diagnostic for NoSuchField { | 35 | impl Diagnostic for NoSuchField { |
36 | fn name(&self) -> String { | 36 | fn name(&self) -> &'static str { |
37 | "no-such-field".to_string() | 37 | "no-such-field" |
38 | } | 38 | } |
39 | 39 | ||
40 | fn message(&self) -> String { | 40 | fn message(&self) -> String { |
@@ -68,8 +68,8 @@ pub struct MissingFields { | |||
68 | } | 68 | } |
69 | 69 | ||
70 | impl Diagnostic for MissingFields { | 70 | impl Diagnostic for MissingFields { |
71 | fn name(&self) -> String { | 71 | fn name(&self) -> &'static str { |
72 | "missing-structure-fields".to_string() | 72 | "missing-structure-fields" |
73 | } | 73 | } |
74 | fn message(&self) -> String { | 74 | fn message(&self) -> String { |
75 | let mut buf = String::from("Missing structure fields:\n"); | 75 | let mut buf = String::from("Missing structure fields:\n"); |
@@ -104,8 +104,8 @@ pub struct MissingPatFields { | |||
104 | } | 104 | } |
105 | 105 | ||
106 | impl Diagnostic for MissingPatFields { | 106 | impl Diagnostic for MissingPatFields { |
107 | fn name(&self) -> String { | 107 | fn name(&self) -> &'static str { |
108 | "missing-pat-fields".to_string() | 108 | "missing-pat-fields" |
109 | } | 109 | } |
110 | fn message(&self) -> String { | 110 | fn message(&self) -> String { |
111 | let mut buf = String::from("Missing structure fields:\n"); | 111 | let mut buf = String::from("Missing structure fields:\n"); |
@@ -130,8 +130,8 @@ pub struct MissingMatchArms { | |||
130 | } | 130 | } |
131 | 131 | ||
132 | impl Diagnostic for MissingMatchArms { | 132 | impl Diagnostic for MissingMatchArms { |
133 | fn name(&self) -> String { | 133 | fn name(&self) -> &'static str { |
134 | "missing-match-arm".to_string() | 134 | "missing-match-arm" |
135 | } | 135 | } |
136 | fn message(&self) -> String { | 136 | fn message(&self) -> String { |
137 | String::from("Missing match arm") | 137 | String::from("Missing match arm") |
@@ -151,8 +151,8 @@ pub struct MissingOkInTailExpr { | |||
151 | } | 151 | } |
152 | 152 | ||
153 | impl Diagnostic for MissingOkInTailExpr { | 153 | impl Diagnostic for MissingOkInTailExpr { |
154 | fn name(&self) -> String { | 154 | fn name(&self) -> &'static str { |
155 | "missing-ok-in-tail-expr".to_string() | 155 | "missing-ok-in-tail-expr" |
156 | } | 156 | } |
157 | fn message(&self) -> String { | 157 | fn message(&self) -> String { |
158 | "wrap return expression in Ok".to_string() | 158 | "wrap return expression in Ok".to_string() |
@@ -182,8 +182,8 @@ pub struct BreakOutsideOfLoop { | |||
182 | } | 182 | } |
183 | 183 | ||
184 | impl Diagnostic for BreakOutsideOfLoop { | 184 | impl Diagnostic for BreakOutsideOfLoop { |
185 | fn name(&self) -> String { | 185 | fn name(&self) -> &'static str { |
186 | "break-outside-of-loop".to_string() | 186 | "break-outside-of-loop" |
187 | } | 187 | } |
188 | fn message(&self) -> String { | 188 | fn message(&self) -> String { |
189 | "break outside of loop".to_string() | 189 | "break outside of loop".to_string() |
@@ -213,8 +213,8 @@ pub struct MissingUnsafe { | |||
213 | } | 213 | } |
214 | 214 | ||
215 | impl Diagnostic for MissingUnsafe { | 215 | impl Diagnostic for MissingUnsafe { |
216 | fn name(&self) -> String { | 216 | fn name(&self) -> &'static str { |
217 | "missing-unsafe".to_string() | 217 | "missing-unsafe" |
218 | } | 218 | } |
219 | fn message(&self) -> String { | 219 | fn message(&self) -> String { |
220 | format!("This operation is unsafe and requires an unsafe function or block") | 220 | format!("This operation is unsafe and requires an unsafe function or block") |
@@ -246,8 +246,8 @@ pub struct MismatchedArgCount { | |||
246 | } | 246 | } |
247 | 247 | ||
248 | impl Diagnostic for MismatchedArgCount { | 248 | impl Diagnostic for MismatchedArgCount { |
249 | fn name(&self) -> String { | 249 | fn name(&self) -> &'static str { |
250 | "mismatched-arg-count".to_string() | 250 | "mismatched-arg-count" |
251 | } | 251 | } |
252 | fn message(&self) -> String { | 252 | fn message(&self) -> String { |
253 | let s = if self.expected == 1 { "" } else { "s" }; | 253 | let s = if self.expected == 1 { "" } else { "s" }; |