aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-24 11:16:13 +0100
committerPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-03-30 13:52:32 +0200
commit36ead3c1b56838f091f4b223dcfc68ff91e66b8d (patch)
treef4daa5cde440cb826c6de2e9da539a92bbcca399
parent09b2be24391d7543fe76c24c3cf790e915e0ff1a (diff)
downloadgcc-36ead3c1b56838f091f4b223dcfc68ff91e66b8d.zip
gcc-36ead3c1b56838f091f4b223dcfc68ff91e66b8d.tar.gz
gcc-36ead3c1b56838f091f4b223dcfc68ff91e66b8d.tar.bz2
libproc_macro: Change string format
Change string format to match older rust version. Inline variable name were not available with rust 1.49. ChangeLog: * librust/proc_macro/rust/bridge/literal.rs: Change inline variable name format to usual empty "{}" along with arguments. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--librust/proc_macro/rust/bridge/literal.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/librust/proc_macro/rust/bridge/literal.rs b/librust/proc_macro/rust/bridge/literal.rs
index c2017ac..080cc1b 100644
--- a/librust/proc_macro/rust/bridge/literal.rs
+++ b/librust/proc_macro/rust/bridge/literal.rs
@@ -255,7 +255,7 @@ impl fmt::Display for Literal {
if byte != b'"' && (b' '..=b'z').contains(&byte) {
char::try_from(byte).unwrap().fmt(f)?;
} else {
- write!(f, "\\x{byte:02x}")?;
+ write!(f, "\\x{:02x}", byte)?;
}
}
f.write_str("b\"")?;
@@ -266,8 +266,8 @@ impl fmt::Display for Literal {
'\'' => f.write_str("'\\''")?,
'\0' => f.write_str("'\\0'")?,
'\n' => f.write_str("'\\n'")?,
- ' '..='z' => write!(f, "'{ch}'")?,
- _ => write!(f, "'\\u{val:x}'")?,
+ ' '..='z' => write!(f, "'{}'", ch)?,
+ _ => write!(f, "'\\u{:x}'", val)?,
}
}
Literal::Unsigned(val, suffixed) => match val {