aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/syntax_node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/syntax_node.rs')
-rw-r--r--crates/ra_syntax/src/syntax_node.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs
index 80054f529..e4eab6b87 100644
--- a/crates/ra_syntax/src/syntax_node.rs
+++ b/crates/ra_syntax/src/syntax_node.rs
@@ -9,7 +9,6 @@
9use std::{ 9use std::{
10 ops::RangeInclusive, 10 ops::RangeInclusive,
11 fmt::{self, Write}, 11 fmt::{self, Write},
12 any::Any,
13 borrow::Borrow, 12 borrow::Borrow,
14 iter::successors, 13 iter::successors,
15}; 14};
@@ -133,10 +132,8 @@ pub enum Direction {
133} 132}
134 133
135impl SyntaxNode { 134impl SyntaxNode {
136 pub(crate) fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreeArc<SyntaxNode> { 135 pub(crate) fn new(green: GreenNode) -> TreeArc<SyntaxNode> {
137 let errors: Option<Box<Any + Send + Sync>> = 136 let ptr = TreeArc(rowan::SyntaxNode::new(green, None));
138 if errors.is_empty() { None } else { Some(Box::new(errors)) };
139 let ptr = TreeArc(rowan::SyntaxNode::new(green, errors));
140 TreeArc::cast(ptr) 137 TreeArc::cast(ptr)
141 } 138 }
142 139
@@ -630,8 +627,8 @@ impl SyntaxTreeBuilder {
630 } 627 }
631 628
632 pub fn finish(self) -> TreeArc<SyntaxNode> { 629 pub fn finish(self) -> TreeArc<SyntaxNode> {
633 let (green, errors) = self.finish_raw(); 630 let (green, _errors) = self.finish_raw();
634 let node = SyntaxNode::new(green, errors); 631 let node = SyntaxNode::new(green);
635 if cfg!(debug_assertions) { 632 if cfg!(debug_assertions) {
636 crate::validation::validate_block_structure(&node); 633 crate::validation::validate_block_structure(&node);
637 } 634 }