mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Fix build for Diagnostic type change
This commit is contained in:
parent
200470692f
commit
6a04e9ce14
1 changed files with 4 additions and 7 deletions
|
@ -154,11 +154,8 @@ impl Diagnostic for MissingOkInTailExpr {
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
"wrap return expression in Ok".to_string()
|
"wrap return expression in Ok".to_string()
|
||||||
}
|
}
|
||||||
fn file(&self) -> HirFileId {
|
fn source(&self) -> Source<SyntaxNodePtr> {
|
||||||
self.file
|
Source { file_id: self.file, ast: self.expr.into() }
|
||||||
}
|
|
||||||
fn syntax_node_ptr(&self) -> SyntaxNodePtr {
|
|
||||||
self.expr.into()
|
|
||||||
}
|
}
|
||||||
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
||||||
self
|
self
|
||||||
|
@ -169,8 +166,8 @@ impl AstDiagnostic for MissingOkInTailExpr {
|
||||||
type AST = ast::Expr;
|
type AST = ast::Expr;
|
||||||
|
|
||||||
fn ast(&self, db: &impl HirDatabase) -> Self::AST {
|
fn ast(&self, db: &impl HirDatabase) -> Self::AST {
|
||||||
let root = db.parse_or_expand(self.file()).unwrap();
|
let root = db.parse_or_expand(self.file).unwrap();
|
||||||
let node = self.syntax_node_ptr().to_node(&root);
|
let node = self.source().ast.to_node(&root);
|
||||||
ast::Expr::cast(node).unwrap()
|
ast::Expr::cast(node).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue