diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index a950870bdd..6a4f3ff130 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -74,8 +74,8 @@ impl Parse { pub use crate::ast::SourceFile; impl SourceFile { - fn new(green: GreenNode, errors: Vec) -> TreeArc { - let root = SyntaxNode::new(green, errors); + fn new(green: GreenNode, _errors: Vec) -> TreeArc { + let root = SyntaxNode::new(green); if cfg!(debug_assertions) { validation::validate_block_structure(&root); } diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index 80054f529a..e4eab6b870 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs @@ -9,7 +9,6 @@ use std::{ ops::RangeInclusive, fmt::{self, Write}, - any::Any, borrow::Borrow, iter::successors, }; @@ -133,10 +132,8 @@ pub enum Direction { } impl SyntaxNode { - pub(crate) fn new(green: GreenNode, errors: Vec) -> TreeArc { - let errors: Option> = - if errors.is_empty() { None } else { Some(Box::new(errors)) }; - let ptr = TreeArc(rowan::SyntaxNode::new(green, errors)); + pub(crate) fn new(green: GreenNode) -> TreeArc { + let ptr = TreeArc(rowan::SyntaxNode::new(green, None)); TreeArc::cast(ptr) } @@ -630,8 +627,8 @@ impl SyntaxTreeBuilder { } pub fn finish(self) -> TreeArc { - let (green, errors) = self.finish_raw(); - let node = SyntaxNode::new(green, errors); + let (green, _errors) = self.finish_raw(); + let node = SyntaxNode::new(green); if cfg!(debug_assertions) { crate::validation::validate_block_structure(&node); }