mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Remove this semicolon
This commit is contained in:
parent
e2e6b709e6
commit
cb66bb8ff9
5 changed files with 74 additions and 8 deletions
|
@ -216,6 +216,30 @@ impl Diagnostic for MissingOkInTailExpr {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RemoveThisSemicolon {
|
||||
pub file: HirFileId,
|
||||
pub expr: AstPtr<ast::Expr>,
|
||||
}
|
||||
|
||||
impl Diagnostic for RemoveThisSemicolon {
|
||||
fn code(&self) -> DiagnosticCode {
|
||||
DiagnosticCode("remove-this-semicolon")
|
||||
}
|
||||
|
||||
fn message(&self) -> String {
|
||||
"Remove this semicolon".to_string()
|
||||
}
|
||||
|
||||
fn display_source(&self) -> InFile<SyntaxNodePtr> {
|
||||
InFile { file_id: self.file, value: self.expr.clone().into() }
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
// Diagnostic: break-outside-of-loop
|
||||
//
|
||||
// This diagnostic is triggered if `break` keyword is used outside of a loop.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue