mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Fix unescaping of C string literals
This commit is contained in:
parent
de1f766820
commit
59a3e42ac9
6 changed files with 49 additions and 21 deletions
|
|
@ -634,7 +634,7 @@ impl Printer<'_> {
|
|||
match literal {
|
||||
Literal::String(it) => w!(self, "{:?}", it),
|
||||
Literal::ByteString(it) => w!(self, "\"{}\"", it.escape_ascii()),
|
||||
Literal::CString(it) => w!(self, "\"{}\\0\"", it),
|
||||
Literal::CString(it) => w!(self, "\"{}\\0\"", it.escape_ascii()),
|
||||
Literal::Char(it) => w!(self, "'{}'", it.escape_debug()),
|
||||
Literal::Bool(it) => w!(self, "{}", it),
|
||||
Literal::Int(i, suffix) => {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ impl fmt::Display for FloatTypeWrapper {
|
|||
pub enum Literal {
|
||||
String(Box<str>),
|
||||
ByteString(Box<[u8]>),
|
||||
CString(Box<str>),
|
||||
CString(Box<[u8]>),
|
||||
Char(char),
|
||||
Bool(bool),
|
||||
Int(i128, Option<BuiltinInt>),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue