aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/diagnostics.rs')
-rw-r--r--crates/hir_ty/src/diagnostics.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics.rs b/crates/hir_ty/src/diagnostics.rs
index b58fe0ed7..e59487e54 100644
--- a/crates/hir_ty/src/diagnostics.rs
+++ b/crates/hir_ty/src/diagnostics.rs
@@ -216,6 +216,30 @@ impl Diagnostic for MissingOkInTailExpr {
216 } 216 }
217} 217}
218 218
219#[derive(Debug)]
220pub struct RemoveThisSemicolon {
221 pub file: HirFileId,
222 pub expr: AstPtr<ast::Expr>,
223}
224
225impl Diagnostic for RemoveThisSemicolon {
226 fn code(&self) -> DiagnosticCode {
227 DiagnosticCode("remove-this-semicolon")
228 }
229
230 fn message(&self) -> String {
231 "Remove this semicolon".to_string()
232 }
233
234 fn display_source(&self) -> InFile<SyntaxNodePtr> {
235 InFile { file_id: self.file, value: self.expr.clone().into() }
236 }
237
238 fn as_any(&self) -> &(dyn Any + Send + 'static) {
239 self
240 }
241}
242
219// Diagnostic: break-outside-of-loop 243// Diagnostic: break-outside-of-loop
220// 244//
221// This diagnostic is triggered if `break` keyword is used outside of a loop. 245// This diagnostic is triggered if `break` keyword is used outside of a loop.