Skip to content

Commit 01e45bf

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: rust-lang#127890 [1]
1 parent 22572d0 commit 01e45bf

File tree

4 files changed

+49
-36
lines changed

4 files changed

+49
-36
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2186,9 +2186,9 @@ dependencies = [
21862186

21872187
[[package]]
21882188
name = "memchr"
2189-
version = "2.5.0"
2189+
version = "2.7.4"
21902190
source = "registry+https://github.com/rust-lang/crates.io-index"
2191-
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
2191+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
21922192

21932193
[[package]]
21942194
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

+42-32
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
4242

4343
[[package]]
4444
name = "cc"
45-
version = "1.0.99"
45+
version = "1.1.15"
4646
source = "registry+https://github.com/rust-lang/crates.io-index"
47-
checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"
47+
checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6"
48+
dependencies = [
49+
"shlex",
50+
]
4851

4952
[[package]]
5053
name = "cfg-if"
@@ -58,9 +61,9 @@ dependencies = [
5861

5962
[[package]]
6063
name = "compiler_builtins"
61-
version = "0.1.121"
64+
version = "0.1.122"
6265
source = "registry+https://github.com/rust-lang/crates.io-index"
63-
checksum = "ce956e6dc07082ec481f0935a51e83b343f8ca51be560452c0ebf830d0bdf5a5"
66+
checksum = "94d9eb5c3e8b84831ea59a2948f0b9ffec898044c28337f28f52b0781d08c459"
6467
dependencies = [
6568
"cc",
6669
"rustc-std-workspace-core",
@@ -110,9 +113,9 @@ dependencies = [
110113

111114
[[package]]
112115
name = "gimli"
113-
version = "0.28.1"
116+
version = "0.29.0"
114117
source = "registry+https://github.com/rust-lang/crates.io-index"
115-
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
118+
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
116119
dependencies = [
117120
"compiler_builtins",
118121
"rustc-std-workspace-alloc",
@@ -121,9 +124,9 @@ dependencies = [
121124

122125
[[package]]
123126
name = "gimli"
124-
version = "0.29.0"
127+
version = "0.30.0"
125128
source = "registry+https://github.com/rust-lang/crates.io-index"
126-
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
129+
checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9"
127130
dependencies = [
128131
"compiler_builtins",
129132
"rustc-std-workspace-alloc",
@@ -186,9 +189,9 @@ dependencies = [
186189

187190
[[package]]
188191
name = "object"
189-
version = "0.36.2"
192+
version = "0.36.3"
190193
source = "registry+https://github.com/rust-lang/crates.io-index"
191-
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
194+
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
192195
dependencies = [
193196
"compiler_builtins",
194197
"memchr",
@@ -312,6 +315,12 @@ dependencies = [
312315
"std",
313316
]
314317

318+
[[package]]
319+
name = "shlex"
320+
version = "1.3.0"
321+
source = "registry+https://github.com/rust-lang/crates.io-index"
322+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
323+
315324
[[package]]
316325
name = "std"
317326
version = "0.0.0"
@@ -326,6 +335,7 @@ dependencies = [
326335
"hashbrown",
327336
"hermit-abi",
328337
"libc",
338+
"memchr",
329339
"miniz_oxide",
330340
"object",
331341
"panic_abort",
@@ -396,12 +406,12 @@ dependencies = [
396406

397407
[[package]]
398408
name = "unwinding"
399-
version = "0.2.1"
409+
version = "0.2.2"
400410
source = "registry+https://github.com/rust-lang/crates.io-index"
401-
checksum = "37a19a21a537f635c16c7576f22d0f2f7d63353c1337ad4ce0d8001c7952a25b"
411+
checksum = "dc55842d0db6329a669d55a623c674b02d677b16bfb2d24857d4089d41eba882"
402412
dependencies = [
403413
"compiler_builtins",
404-
"gimli 0.28.1",
414+
"gimli 0.30.0",
405415
"rustc-std-workspace-core",
406416
]
407417

@@ -422,7 +432,7 @@ version = "0.52.0"
422432
source = "registry+https://github.com/rust-lang/crates.io-index"
423433
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
424434
dependencies = [
425-
"windows-targets 0.52.5",
435+
"windows-targets 0.52.6",
426436
]
427437

428438
[[package]]
@@ -431,9 +441,9 @@ version = "0.0.0"
431441

432442
[[package]]
433443
name = "windows-targets"
434-
version = "0.52.5"
444+
version = "0.52.6"
435445
source = "registry+https://github.com/rust-lang/crates.io-index"
436-
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
446+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
437447
dependencies = [
438448
"windows_aarch64_gnullvm",
439449
"windows_aarch64_msvc",
@@ -447,48 +457,48 @@ dependencies = [
447457

448458
[[package]]
449459
name = "windows_aarch64_gnullvm"
450-
version = "0.52.5"
460+
version = "0.52.6"
451461
source = "registry+https://github.com/rust-lang/crates.io-index"
452-
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
462+
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
453463

454464
[[package]]
455465
name = "windows_aarch64_msvc"
456-
version = "0.52.5"
466+
version = "0.52.6"
457467
source = "registry+https://github.com/rust-lang/crates.io-index"
458-
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
468+
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
459469

460470
[[package]]
461471
name = "windows_i686_gnu"
462-
version = "0.52.5"
472+
version = "0.52.6"
463473
source = "registry+https://github.com/rust-lang/crates.io-index"
464-
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
474+
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
465475

466476
[[package]]
467477
name = "windows_i686_gnullvm"
468-
version = "0.52.5"
478+
version = "0.52.6"
469479
source = "registry+https://github.com/rust-lang/crates.io-index"
470-
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
480+
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
471481

472482
[[package]]
473483
name = "windows_i686_msvc"
474-
version = "0.52.5"
484+
version = "0.52.6"
475485
source = "registry+https://github.com/rust-lang/crates.io-index"
476-
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
486+
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
477487

478488
[[package]]
479489
name = "windows_x86_64_gnu"
480-
version = "0.52.5"
490+
version = "0.52.6"
481491
source = "registry+https://github.com/rust-lang/crates.io-index"
482-
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
492+
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
483493

484494
[[package]]
485495
name = "windows_x86_64_gnullvm"
486-
version = "0.52.5"
496+
version = "0.52.6"
487497
source = "registry+https://github.com/rust-lang/crates.io-index"
488-
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
498+
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
489499

490500
[[package]]
491501
name = "windows_x86_64_msvc"
492-
version = "0.52.5"
502+
version = "0.52.6"
493503
source = "registry+https://github.com/rust-lang/crates.io-index"
494-
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
504+
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

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)