diff options
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/syntax_node.rs | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index a950870bd..6a4f3ff13 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -74,8 +74,8 @@ impl Parse { | |||
74 | pub use crate::ast::SourceFile; | 74 | pub use crate::ast::SourceFile; |
75 | 75 | ||
76 | impl SourceFile { | 76 | impl SourceFile { |
77 | fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreeArc<SourceFile> { | 77 | fn new(green: GreenNode, _errors: Vec<SyntaxError>) -> TreeArc<SourceFile> { |
78 | let root = SyntaxNode::new(green, errors); | 78 | let root = SyntaxNode::new(green); |
79 | if cfg!(debug_assertions) { | 79 | if cfg!(debug_assertions) { |
80 | validation::validate_block_structure(&root); | 80 | validation::validate_block_structure(&root); |
81 | } | 81 | } |
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 @@ | |||
9 | use std::{ | 9 | use 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 | ||
135 | impl SyntaxNode { | 134 | impl 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 | } |