aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/yellow/syntax_error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/yellow/syntax_error.rs')
-rw-r--r--crates/ra_syntax/src/yellow/syntax_error.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs
index c52c44cc3..412cf82cc 100644
--- a/crates/ra_syntax/src/yellow/syntax_error.rs
+++ b/crates/ra_syntax/src/yellow/syntax_error.rs
@@ -28,10 +28,7 @@ impl Into<Location> for TextRange {
28 28
29impl SyntaxError { 29impl SyntaxError {
30 pub fn new<L: Into<Location>>(kind: SyntaxErrorKind, loc: L) -> SyntaxError { 30 pub fn new<L: Into<Location>>(kind: SyntaxErrorKind, loc: L) -> SyntaxError {
31 SyntaxError { 31 SyntaxError { kind, location: loc.into() }
32 kind,
33 location: loc.into(),
34 }
35 } 32 }
36 33
37 pub fn kind(&self) -> SyntaxErrorKind { 34 pub fn kind(&self) -> SyntaxErrorKind {
@@ -119,10 +116,9 @@ impl fmt::Display for SyntaxErrorKind {
119 InvalidByteEscape => write!(f, "Invalid escape sequence"), 116 InvalidByteEscape => write!(f, "Invalid escape sequence"),
120 TooShortByteCodeEscape => write!(f, "Escape sequence should have two digits"), 117 TooShortByteCodeEscape => write!(f, "Escape sequence should have two digits"),
121 MalformedByteCodeEscape => write!(f, "Escape sequence should be a hexadecimal number"), 118 MalformedByteCodeEscape => write!(f, "Escape sequence should be a hexadecimal number"),
122 UnicodeEscapeForbidden => write!( 119 UnicodeEscapeForbidden => {
123 f, 120 write!(f, "Unicode escapes are not allowed in byte literals or byte strings")
124 "Unicode escapes are not allowed in byte literals or byte strings" 121 }
125 ),
126 TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"), 122 TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"),
127 AsciiCodeEscapeOutOfRange => { 123 AsciiCodeEscapeOutOfRange => {
128 write!(f, "Escape sequence should be between \\x00 and \\x7F") 124 write!(f, "Escape sequence should be between \\x00 and \\x7F")