From e2b28f5bb8043e92b10f6a40696131007fc9dfe2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 19 Jul 2019 10:43:01 +0300 Subject: migrate ra_hir to the new rowan --- crates/ra_hir/src/diagnostics.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src/diagnostics.rs') diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index c97f0656d..0290483b3 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs @@ -1,6 +1,6 @@ use std::{any::Any, fmt}; -use ra_syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr, TextRange, TreeArc}; +use ra_syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr, TextRange}; use relative_path::RelativePathBuf; use crate::{HirDatabase, HirFileId, Name}; @@ -33,9 +33,9 @@ pub trait AstDiagnostic { } impl dyn Diagnostic { - pub fn syntax_node(&self, db: &impl HirDatabase) -> TreeArc { + pub fn syntax_node(&self, db: &impl HirDatabase) -> SyntaxNode { let node = db.parse_or_expand(self.file()).unwrap(); - self.syntax_node_ptr().to_node(&*node).to_owned() + self.syntax_node_ptr().to_node(&node) } pub fn downcast_ref(&self) -> Option<&D> { @@ -143,11 +143,11 @@ impl Diagnostic for MissingFields { } impl AstDiagnostic for MissingFields { - type AST = TreeArc; + type AST = ast::NamedFieldList; 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); - ast::NamedFieldList::cast(&node).unwrap().to_owned() + let node = self.syntax_node_ptr().to_node(&root); + ast::NamedFieldList::cast(node).unwrap() } } -- cgit v1.2.3