about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-24 16:46:57 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-25 12:26:25 +1100
commit4b4bdb575b8498b22729a522885ffadd0e646c0f (patch)
treed24ea98559775ef0fa476b3a44e8b34472bbe8a5
parent314dbc7f2250cc7bece306254f6bfafc96bf913f (diff)
downloadrust-4b4bdb575b8498b22729a522885ffadd0e646c0f.tar.gz
rust-4b4bdb575b8498b22729a522885ffadd0e646c0f.zip
Fix copy/paste error.
The `CString` handling code is erroneously identical to the `ByteString`
handling code.
-rw-r--r--src/tools/rust-analyzer/crates/syntax/src/validation.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax/src/validation.rs b/src/tools/rust-analyzer/crates/syntax/src/validation.rs
index 69dffbf79f1..fadcbaef143 100644
--- a/src/tools/rust-analyzer/crates/syntax/src/validation.rs
+++ b/src/tools/rust-analyzer/crates/syntax/src/validation.rs
@@ -5,7 +5,7 @@
 mod block;
 
 use rowan::Direction;
-use rustc_lexer::unescape::{self, unescape_literal, Mode};
+use rustc_lexer::unescape::{self, unescape_c_string, unescape_literal, Mode};
 
 use crate::{
     algo,
@@ -162,7 +162,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
         ast::LiteralKind::CString(s) => {
             if !s.is_raw() {
                 if let Some(without_quotes) = unquote(text, 2, '"') {
-                    unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
+                    unescape_c_string(without_quotes, Mode::CStr, &mut |range, char| {
                         if let Err(err) = char {
                             push_err(1, range.start, err);
                         }