Skip to content

Commit af33373

Browse files
committed
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]
1 parent 11e760b commit af33373

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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/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 is resolved 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)