File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/libsyntax/parse/lexer Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -742,7 +742,7 @@ impl<'a> StringReader<'a> {
742
742
let valid = self . scan_unicode_escape ( delim) ;
743
743
if valid && ascii_only {
744
744
self . err_span_ (
745
- escaped_pos ,
745
+ start ,
746
746
self . last_pos ,
747
747
"unicode escape sequences cannot be used as a byte or in \
748
748
a byte string"
@@ -753,9 +753,9 @@ impl<'a> StringReader<'a> {
753
753
}
754
754
}
755
755
'u' if !ascii_only => {
756
- self . err_span_ ( escaped_pos , self . last_pos ,
756
+ self . err_span_ ( start , self . last_pos ,
757
757
"incomplete unicode escape sequence" ) ;
758
- self . help_span_ ( escaped_pos , self . last_pos ,
758
+ self . help_span_ ( start , self . last_pos ,
759
759
"format of unicode escape sequences is `\\ u{…}`" ) ;
760
760
false
761
761
}
@@ -862,14 +862,12 @@ impl<'a> StringReader<'a> {
862
862
valid = false ;
863
863
}
864
864
865
- self . bump ( ) ; // past the ending }
866
-
867
865
if valid && ( char:: from_u32 ( accum_int) . is_none ( ) || count == 0 ) {
868
866
self . err_span_ ( start_bpos, self . last_pos , "illegal unicode character escape" ) ;
869
867
valid = false ;
870
868
}
871
869
872
-
870
+ self . bump ( ) ; // past the ending }
873
871
valid
874
872
}
875
873
You can’t perform that action at this time.
0 commit comments