Skip to content

Commit b28864a

Browse files
authored
Rollup merge of rust-lang#143631 - hkBst:update-escaper-2, r=compiler-errors
update to literal-escaper-0.0.5 Quoting from the changelog, this version brings: - Use `NonZero<char/u8>` in `unescape_c_str` and `check_raw_c_str` to statically exclude nuls - Add `#[inline]` to small functions for improved performance
2 parents ba0eef2 + 114bf21 commit b28864a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proc_macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ std = { path = "../std" }
99
# `core` when resolving doc links. Without this line a different `core` will be
1010
# loaded from sysroot causing duplicate lang items and other similar errors.
1111
core = { path = "../core" }
12-
rustc-literal-escaper = { version = "0.0.4", features = ["rustc-dep-of-std"] }
12+
rustc-literal-escaper = { version = "0.0.5", features = ["rustc-dep-of-std"] }
1313

1414
[features]
1515
default = ["rustc-dep-of-std"]

proc_macro/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,11 +1471,11 @@ impl Literal {
14711471
let mut error = None;
14721472
let mut buf = Vec::with_capacity(symbol.len());
14731473

1474-
unescape_c_str(symbol, |_span, c| match c {
1474+
unescape_c_str(symbol, |_span, res| match res {
14751475
Ok(MixedUnit::Char(c)) => {
1476-
buf.extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes())
1476+
buf.extend_from_slice(c.get().encode_utf8(&mut [0; 4]).as_bytes())
14771477
}
1478-
Ok(MixedUnit::HighByte(b)) => buf.push(b),
1478+
Ok(MixedUnit::HighByte(b)) => buf.push(b.get()),
14791479
Err(err) => {
14801480
if err.is_fatal() {
14811481
error = Some(ConversionErrorKind::FailedToUnescape(err));

0 commit comments

Comments
 (0)