Skip to content

Commit 26a5ee8

Browse files
authored
Unrolled build for #143631
Rollup merge of #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 8c12d76 + d44dcd4 commit 26a5ee8

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,9 +3136,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
31363136

31373137
[[package]]
31383138
name = "rustc-literal-escaper"
3139-
version = "0.0.4"
3139+
version = "0.0.5"
31403140
source = "registry+https://github.com/rust-lang/crates.io-index"
3141-
checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b"
3141+
checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b"
31423142

31433143
[[package]]
31443144
name = "rustc-main"

compiler/rustc_ast/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2024"
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
99
memchr = "2.7.4"
10-
rustc-literal-escaper = "0.0.4"
10+
rustc-literal-escaper = "0.0.5"
1111
rustc_ast_ir = { path = "../rustc_ast_ir" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_index = { path = "../rustc_index" }

compiler/rustc_ast/src/util/literal.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ impl LitKind {
126126
token::CStr => {
127127
let s = symbol.as_str();
128128
let mut buf = Vec::with_capacity(s.len());
129-
unescape_c_str(s, |_span, c| match c {
129+
unescape_c_str(s, |_span, res| match res {
130130
Ok(MixedUnit::Char(c)) => {
131-
buf.extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes())
131+
buf.extend_from_slice(c.get().encode_utf8(&mut [0; 4]).as_bytes())
132132
}
133-
Ok(MixedUnit::HighByte(b)) => buf.push(b),
133+
Ok(MixedUnit::HighByte(b)) => buf.push(b.get()),
134134
Err(err) => {
135135
assert!(!err.is_fatal(), "failed to unescape C string literal")
136136
}

compiler/rustc_parse/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2024"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
rustc-literal-escaper = "0.0.4"
9+
rustc-literal-escaper = "0.0.5"
1010
rustc_ast = { path = "../rustc_ast" }
1111
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }

compiler/rustc_parse_format/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
rustc-literal-escaper = "0.0.4"
8+
rustc-literal-escaper = "0.0.5"
99
rustc_lexer = { path = "../rustc_lexer" }
1010
# tidy-alphabetical-end
1111

compiler/rustc_proc_macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test = false
1515
doctest = false
1616

1717
[dependencies]
18-
rustc-literal-escaper = "0.0.4"
18+
rustc-literal-escaper = "0.0.5"
1919

2020
[features]
2121
rustc-dep-of-std = []

library/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ dependencies = [
271271

272272
[[package]]
273273
name = "rustc-literal-escaper"
274-
version = "0.0.4"
274+
version = "0.0.5"
275275
source = "registry+https://github.com/rust-lang/crates.io-index"
276-
checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b"
276+
checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b"
277277
dependencies = [
278278
"rustc-std-workspace-core",
279279
"rustc-std-workspace-std",

library/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"]

library/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));

src/tools/lint-docs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description = "A script to extract the lint documentation for the rustc book."
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
rustc-literal-escaper = "0.0.4"
10+
rustc-literal-escaper = "0.0.5"
1111
serde_json = "1.0.57"
1212
tempfile = "3.1.0"
1313
walkdir = "2.3.1"

0 commit comments

Comments
 (0)