mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-08 03:20:37 +00:00
Fix the same bug as #396 but for bytes too
This commit is contained in:
parent
5a866a772c
commit
0ddeb3b824
2 changed files with 4 additions and 1 deletions
|
@ -88,7 +88,9 @@ fn validate_byte_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxErr
|
|||
|
||||
fn validate_byte_code_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxError>) {
|
||||
// A ByteCodeEscape has 4 chars, example: `\xDD`
|
||||
if text.len() < 4 {
|
||||
if !text.is_ascii() {
|
||||
errors.push(SyntaxError::new(MalformedByteCodeEscape, range));
|
||||
} else if text.chars().count() < 4 {
|
||||
errors.push(SyntaxError::new(TooShortByteCodeEscape, range));
|
||||
} else {
|
||||
assert!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue