From 6a04e9ce147cba1ae4da177f271a29eb296a9bef Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Tue, 13 Aug 2019 07:31:06 +0100 Subject: Fix build for Diagnostic type change --- crates/ra_hir/src/diagnostics.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index 718345d75..475dd5766 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs @@ -154,11 +154,8 @@ impl Diagnostic for MissingOkInTailExpr { fn message(&self) -> String { "wrap return expression in Ok".to_string() } - fn file(&self) -> HirFileId { - self.file - } - fn syntax_node_ptr(&self) -> SyntaxNodePtr { - self.expr.into() + fn source(&self) -> Source { + Source { file_id: self.file, ast: self.expr.into() } } fn as_any(&self) -> &(dyn Any + Send + 'static) { self @@ -169,8 +166,8 @@ impl AstDiagnostic for MissingOkInTailExpr { type AST = ast::Expr; fn ast(&self, db: &impl HirDatabase) -> Self::AST { - let root = db.parse_or_expand(self.file()).unwrap(); - let node = self.syntax_node_ptr().to_node(&root); + let root = db.parse_or_expand(self.file).unwrap(); + let node = self.source().ast.to_node(&root); ast::Expr::cast(node).unwrap() } } -- cgit v1.2.3