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> {
742742 let valid = self . scan_unicode_escape ( delim) ;
743743 if valid && ascii_only {
744744 self . err_span_ (
745- escaped_pos ,
745+ start ,
746746 self . last_pos ,
747747 "unicode escape sequences cannot be used as a byte or in \
748748 a byte string"
@@ -753,9 +753,9 @@ impl<'a> StringReader<'a> {
753753 }
754754 }
755755 'u' if !ascii_only => {
756- self . err_span_ ( escaped_pos , self . last_pos ,
756+ self . err_span_ ( start , self . last_pos ,
757757 "incomplete unicode escape sequence" ) ;
758- self . help_span_ ( escaped_pos , self . last_pos ,
758+ self . help_span_ ( start , self . last_pos ,
759759 "format of unicode escape sequences is `\\ u{…}`" ) ;
760760 false
761761 }
@@ -862,14 +862,12 @@ impl<'a> StringReader<'a> {
862862 valid = false ;
863863 }
864864
865- self . bump ( ) ; // past the ending }
866-
867865 if valid && ( char:: from_u32 ( accum_int) . is_none ( ) || count == 0 ) {
868866 self . err_span_ ( start_bpos, self . last_pos , "illegal unicode character escape" ) ;
869867 valid = false ;
870868 }
871869
872-
870+ self . bump ( ) ; // past the ending }
873871 valid
874872 }
875873
You can’t perform that action at this time.
0 commit comments