Skip to content

Commit cfd4ca2

Browse files
committed
Fix copy/paste error.
The `CString` handling code is erroneously identical to the `ByteString` handling code.
1 parent 0473c67 commit cfd4ca2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/rust-analyzer/crates/syntax/src/validation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
mod block;
66

77
use rowan::Direction;
8-
use rustc_lexer::unescape::{self, unescape_literal, Mode};
8+
use rustc_lexer::unescape::{self, unescape_c_string, unescape_literal, Mode};
99

1010
use crate::{
1111
algo,
@@ -162,7 +162,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
162162
ast::LiteralKind::CString(s) => {
163163
if !s.is_raw() {
164164
if let Some(without_quotes) = unquote(text, 2, '"') {
165-
unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
165+
unescape_c_string(without_quotes, Mode::CStr, &mut |range, char| {
166166
if let Err(err) = char {
167167
push_err(1, range.start, err);
168168
}

0 commit comments

Comments
 (0)