Skip to content

Commit 97fc1f6

Browse files
committed
Auto merge of #138602 - Veykril:push-purxoytpktpu, r=SparrowLii
Slim `rustc_parse_format` dependencies down `rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead. This allows the crate to built without having to wait for `syn` (pulled in by `rustc_index_macros`) Alternatively we could inline the macro, though from the looks of it that will run into trouble with `rustc_randomized_layouts`
2 parents 60a3084 + 5950c86 commit 97fc1f6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_parse_format/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ edition = "2024"
88
rustc_lexer = { path = "../rustc_lexer" }
99
# tidy-alphabetical-end
1010

11-
[target.'cfg(target_pointer_width = "64")'.dependencies]
11+
[target.'cfg(target_pointer_width = "64")'.dev-dependencies]
12+
# tidy-alphabetical-start
1213
rustc_index = { path = "../rustc_index", default-features = false }
14+
# tidy-alphabetical-end

compiler/rustc_parse_format/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ fn unescape_string(string: &str) -> Option<String> {
11051105
}
11061106

11071107
// Assert a reasonable size for `Piece`
1108-
#[cfg(target_pointer_width = "64")]
1108+
#[cfg(all(test, target_pointer_width = "64"))]
11091109
rustc_index::static_assert_size!(Piece<'_>, 16);
11101110

11111111
#[cfg(test)]

0 commit comments

Comments
 (0)