about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/util/literal.rs
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-03-06 07:10:23 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-05-02 10:30:09 +0000
commit76d1f93896fb642cd27cbe8ef481b66e974dbdf9 (patch)
treeb0d2e91cf2772020af75eb631874fdb3aaffb11a /compiler/rustc_ast/src/util/literal.rs
parent8ff3903643b530c9029e8f2c6c6956fda8f21d77 (diff)
downloadrust-76d1f93896fb642cd27cbe8ef481b66e974dbdf9.tar.gz
rust-76d1f93896fb642cd27cbe8ef481b66e974dbdf9.zip
update and add a few tests
Diffstat (limited to 'compiler/rustc_ast/src/util/literal.rs')
-rw-r--r--compiler/rustc_ast/src/util/literal.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/util/literal.rs b/compiler/rustc_ast/src/util/literal.rs
index 8534011e189..5fa0ea35455 100644
--- a/compiler/rustc_ast/src/util/literal.rs
+++ b/compiler/rustc_ast/src/util/literal.rs
@@ -181,7 +181,7 @@ impl LitKind {
                     }
                 });
                 error?;
-                buf.push(b'\0');
+                buf.push(0);
                 LitKind::CStr(buf.into(), StrStyle::Cooked)
             }
             token::CStrRaw(n) => {
@@ -204,7 +204,7 @@ impl LitKind {
                     }
                 });
                 error?;
-                buf.push(b'\0');
+                buf.push(0);
                 LitKind::CStr(buf.into(), StrStyle::Raw(n))
             }
             token::Err => LitKind::Err,