diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_parser/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_parser/src/parser.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/syntax_node.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index e08ad4dae..eeb8ad66b 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs | |||
@@ -25,7 +25,7 @@ pub(crate) use token_set::TokenSet; | |||
25 | pub use syntax_kind::SyntaxKind; | 25 | pub use syntax_kind::SyntaxKind; |
26 | 26 | ||
27 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 27 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
28 | pub struct ParseError(pub String); | 28 | pub struct ParseError(pub Box<String>); |
29 | 29 | ||
30 | /// `TokenSource` abstracts the source of the tokens parser operates on. | 30 | /// `TokenSource` abstracts the source of the tokens parser operates on. |
31 | /// | 31 | /// |
diff --git a/crates/ra_parser/src/parser.rs b/crates/ra_parser/src/parser.rs index faa63d53f..4f59b0a23 100644 --- a/crates/ra_parser/src/parser.rs +++ b/crates/ra_parser/src/parser.rs | |||
@@ -192,7 +192,7 @@ impl<'t> Parser<'t> { | |||
192 | /// structured errors with spans and notes, like rustc | 192 | /// structured errors with spans and notes, like rustc |
193 | /// does. | 193 | /// does. |
194 | pub(crate) fn error<T: Into<String>>(&mut self, message: T) { | 194 | pub(crate) fn error<T: Into<String>>(&mut self, message: T) { |
195 | let msg = ParseError(message.into()); | 195 | let msg = ParseError(Box::new(message.into())); |
196 | self.push_event(Event::Error { msg }) | 196 | self.push_event(Event::Error { msg }) |
197 | } | 197 | } |
198 | 198 | ||
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index f9d379abf..e566af7e8 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs | |||
@@ -70,6 +70,6 @@ impl SyntaxTreeBuilder { | |||
70 | } | 70 | } |
71 | 71 | ||
72 | pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextSize) { | 72 | pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextSize) { |
73 | self.errors.push(SyntaxError::new_at_offset(error.0, text_pos)) | 73 | self.errors.push(SyntaxError::new_at_offset(*error.0, text_pos)) |
74 | } | 74 | } |
75 | } | 75 | } |