Skip to content

Commit 9bdef3c

Browse files
authored
Rollup merge of #130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-Simulacrum
Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: #127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
2 parents 3b45f8f + e95d15a commit 9bdef3c

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2177,9 +2177,9 @@ dependencies = [
21772177

21782178
[[package]]
21792179
name = "memchr"
2180-
version = "2.5.0"
2180+
version = "2.7.4"
21812181
source = "registry+https://github.com/rust-lang/crates.io-index"
2182-
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
2182+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
21832183

21842184
[[package]]
21852185
name = "memmap2"

compiler/rustc_ast/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7-
# FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto
87
# tidy-alphabetical-start
98
bitflags = "2.4.1"
10-
memchr = "=2.5.0"
9+
memchr = "2.7.4"
1110
rustc_ast_ir = { path = "../rustc_ast_ir" }
1211
rustc_data_structures = { path = "../rustc_data_structures" }
1312
rustc_index = { path = "../rustc_index" }

library/Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ dependencies = [
326326
"hashbrown",
327327
"hermit-abi",
328328
"libc",
329+
"memchr",
329330
"miniz_oxide",
330331
"object",
331332
"panic_abort",

library/std/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ unwind = { path = "../unwind" }
2323
hashbrown = { version = "0.14", default-features = false, features = [
2424
'rustc-dep-of-std',
2525
] }
26+
# FIXME(#127890): `object` depends on `memchr`, but `memchr` > v2.5 causes
27+
# issues with LTO. This dependency is not used directly, but pin it here so
28+
# it resolves to 2.5. To be removed once rust-lang/rust#127890 is fixed.
29+
memchr = { version = "=2.5.0", default-features = false, features = ["rustc-dep-of-std"] }
2630
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = [
2731
'rustc-dep-of-std',
2832
] }

0 commit comments

Comments
 (0)