Skip to content

Commit 929117e

Browse files
authored
Merge pull request #4301 from rust-lang/rustup-2025-04-29
Automatic Rustup
2 parents fe89e79 + 0917a07 commit 929117e

File tree

416 files changed

+7702
-3797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

416 files changed

+7702
-3797
lines changed

Cargo.lock

+31-63
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ dependencies = [
737737
"libc",
738738
"miow",
739739
"miropt-test-tools",
740+
"rayon",
740741
"regex",
741742
"rustfix",
742743
"semver",
@@ -3699,6 +3700,9 @@ dependencies = [
36993700
[[package]]
37003701
name = "rustc_fs_util"
37013702
version = "0.0.0"
3703+
dependencies = [
3704+
"tempfile",
3705+
]
37023706

37033707
[[package]]
37043708
name = "rustc_graphviz"
@@ -3753,7 +3757,6 @@ dependencies = [
37533757
"rustc_middle",
37543758
"rustc_session",
37553759
"rustc_span",
3756-
"rustc_target",
37573760
"rustc_trait_selection",
37583761
"smallvec",
37593762
"tracing",
@@ -3792,6 +3795,7 @@ dependencies = [
37923795
"rustc_middle",
37933796
"rustc_session",
37943797
"rustc_span",
3798+
"rustc_target",
37953799
"rustc_trait_selection",
37963800
"smallvec",
37973801
"tracing",
@@ -4011,7 +4015,6 @@ dependencies = [
40114015
"rustc_session",
40124016
"rustc_span",
40134017
"rustc_target",
4014-
"tempfile",
40154018
"tracing",
40164019
]
40174020

@@ -4915,15 +4918,6 @@ dependencies = [
49154918
"color-eyre",
49164919
]
49174920

4918-
[[package]]
4919-
name = "spdx"
4920-
version = "0.10.8"
4921-
source = "registry+https://github.com/rust-lang/crates.io-index"
4922-
checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193"
4923-
dependencies = [
4924-
"smallvec",
4925-
]
4926-
49274921
[[package]]
49284922
name = "spdx-expression"
49294923
version = "0.5.2"
@@ -5743,9 +5737,9 @@ dependencies = [
57435737

57445738
[[package]]
57455739
name = "wasi-preview1-component-adapter-provider"
5746-
version = "29.0.1"
5740+
version = "31.0.0"
57475741
source = "registry+https://github.com/rust-lang/crates.io-index"
5748-
checksum = "dcd9f21bbde82ba59e415a8725e6ad0d0d7e9e460b1a3ccbca5bdee952c1a324"
5742+
checksum = "86fabda09a0d89ffd1615b297b4a5d4b4d99df9598aeb24685837e63019e927b"
57495743

57505744
[[package]]
57515745
name = "wasm-bindgen"
@@ -5807,17 +5801,17 @@ dependencies = [
58075801

58085802
[[package]]
58095803
name = "wasm-component-ld"
5810-
version = "0.5.12"
5804+
version = "0.5.13"
58115805
source = "registry+https://github.com/rust-lang/crates.io-index"
5812-
checksum = "580305a8e3f1b7a79859a8db897de643533b2851c5eb080fe5800233f16dec88"
5806+
checksum = "a60a07a994a3538b57d8c5f8caba19f4793fb4c7156276e5e90e90acbb829e20"
58135807
dependencies = [
58145808
"anyhow",
58155809
"clap",
58165810
"lexopt",
58175811
"libc",
58185812
"tempfile",
58195813
"wasi-preview1-component-adapter-provider",
5820-
"wasmparser 0.223.1",
5814+
"wasmparser 0.229.0",
58215815
"wat",
58225816
"windows-sys 0.59.0",
58235817
"winsplit",
@@ -5844,39 +5838,24 @@ dependencies = [
58445838

58455839
[[package]]
58465840
name = "wasm-encoder"
5847-
version = "0.223.1"
5848-
source = "registry+https://github.com/rust-lang/crates.io-index"
5849-
checksum = "7a0a96fdeaee8fbeb4bd917fb8157d48c0d61c3b1f4ee4c363c8e8d68b2f4fe8"
5850-
dependencies = [
5851-
"leb128",
5852-
"wasmparser 0.223.1",
5853-
]
5854-
5855-
[[package]]
5856-
name = "wasm-encoder"
5857-
version = "0.228.0"
5841+
version = "0.229.0"
58585842
source = "registry+https://github.com/rust-lang/crates.io-index"
5859-
checksum = "05d30290541f2d4242a162bbda76b8f2d8b1ac59eab3568ed6f2327d52c9b2c4"
5843+
checksum = "38ba1d491ecacb085a2552025c10a675a6fddcbd03b1fc9b36c536010ce265d2"
58605844
dependencies = [
58615845
"leb128fmt",
5862-
"wasmparser 0.228.0",
5846+
"wasmparser 0.229.0",
58635847
]
58645848

58655849
[[package]]
58665850
name = "wasm-metadata"
5867-
version = "0.223.1"
5851+
version = "0.229.0"
58685852
source = "registry+https://github.com/rust-lang/crates.io-index"
5869-
checksum = "e2e7e37883181704d96b89dbd8f1291be13694c71cd0663aebb94b46d235a377"
5853+
checksum = "78fdb7d29a79191ab363dc90c1ddd3a1e880ffd5348d92d48482393a9e6c5f4d"
58705854
dependencies = [
58715855
"anyhow",
58725856
"indexmap",
5873-
"serde",
5874-
"serde_derive",
5875-
"serde_json",
5876-
"spdx",
5877-
"url",
5878-
"wasm-encoder 0.223.1",
5879-
"wasmparser 0.223.1",
5857+
"wasm-encoder 0.229.0",
5858+
"wasmparser 0.229.0",
58805859
]
58815860

58825861
[[package]]
@@ -5900,9 +5879,9 @@ dependencies = [
59005879

59015880
[[package]]
59025881
name = "wasmparser"
5903-
version = "0.223.1"
5882+
version = "0.229.0"
59045883
source = "registry+https://github.com/rust-lang/crates.io-index"
5905-
checksum = "664b980991ed9a8c834eb528a8979ab1109edcf52dc05dd5751e2cc3fb31035d"
5884+
checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c"
59065885
dependencies = [
59075886
"bitflags",
59085887
"hashbrown",
@@ -5911,35 +5890,24 @@ dependencies = [
59115890
"serde",
59125891
]
59135892

5914-
[[package]]
5915-
name = "wasmparser"
5916-
version = "0.228.0"
5917-
source = "registry+https://github.com/rust-lang/crates.io-index"
5918-
checksum = "4abf1132c1fdf747d56bbc1bb52152400c70f336870f968b85e89ea422198ae3"
5919-
dependencies = [
5920-
"bitflags",
5921-
"indexmap",
5922-
"semver",
5923-
]
5924-
59255893
[[package]]
59265894
name = "wast"
5927-
version = "228.0.0"
5895+
version = "229.0.0"
59285896
source = "registry+https://github.com/rust-lang/crates.io-index"
5929-
checksum = "9e5aae124478cb51439f6587f074a3a5e835afd22751c59a87b2e2a882727c97"
5897+
checksum = "63fcaff613c12225696bb163f79ca38ffb40e9300eff0ff4b8aa8b2f7eadf0d9"
59305898
dependencies = [
59315899
"bumpalo",
59325900
"leb128fmt",
59335901
"memchr",
59345902
"unicode-width 0.2.0",
5935-
"wasm-encoder 0.228.0",
5903+
"wasm-encoder 0.229.0",
59365904
]
59375905

59385906
[[package]]
59395907
name = "wat"
5940-
version = "1.228.0"
5908+
version = "1.229.0"
59415909
source = "registry+https://github.com/rust-lang/crates.io-index"
5942-
checksum = "7ec29c89a8d055df988de7236483bf569988ac3d6905899f6af5ef920f9385ad"
5910+
checksum = "4189bad08b70455a9e9e67dc126d2dcf91fac143a80f1046747a5dde6d4c33e0"
59435911
dependencies = [
59445912
"wast",
59455913
]
@@ -6398,9 +6366,9 @@ dependencies = [
63986366

63996367
[[package]]
64006368
name = "wit-component"
6401-
version = "0.223.1"
6369+
version = "0.229.0"
64026370
source = "registry+https://github.com/rust-lang/crates.io-index"
6403-
checksum = "3fc2fcc52a79f6f010a89c867e53e06d4227f86c58984add3e37f32b8e7af5f0"
6371+
checksum = "7f550067740e223bfe6c4878998e81cdbe2529dd9a793dc49248dd6613394e8b"
64046372
dependencies = [
64056373
"anyhow",
64066374
"bitflags",
@@ -6409,17 +6377,17 @@ dependencies = [
64096377
"serde",
64106378
"serde_derive",
64116379
"serde_json",
6412-
"wasm-encoder 0.223.1",
6380+
"wasm-encoder 0.229.0",
64136381
"wasm-metadata",
6414-
"wasmparser 0.223.1",
6382+
"wasmparser 0.229.0",
64156383
"wit-parser",
64166384
]
64176385

64186386
[[package]]
64196387
name = "wit-parser"
6420-
version = "0.223.1"
6388+
version = "0.229.0"
64216389
source = "registry+https://github.com/rust-lang/crates.io-index"
6422-
checksum = "263fde17f1fbe55a413f16eb59094bf751795c6da469a05c3d45ea6c77df6b40"
6390+
checksum = "459c6ba62bf511d6b5f2a845a2a736822e38059c1cfa0b644b467bbbfae4efa6"
64236391
dependencies = [
64246392
"anyhow",
64256393
"id-arena",
@@ -6430,7 +6398,7 @@ dependencies = [
64306398
"serde_derive",
64316399
"serde_json",
64326400
"unicode-xid",
6433-
"wasmparser 0.223.1",
6401+
"wasmparser 0.229.0",
64346402
]
64356403

64366404
[[package]]

bootstrap.example.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
# Note that this will attempt to download GCC even if there are local
181181
# modifications to the `src/gcc` submodule.
182182
# Currently, this is only supported for the `x86_64-unknown-linux-gnu` target.
183-
# download-ci-gcc = false
183+
#download-ci-gcc = false
184184

185185
# =============================================================================
186186
# General build configuration options
@@ -500,7 +500,7 @@
500500
# building without optimizations takes much longer than optimizing. Further, some platforms
501501
# fail to build without this optimization (c.f. #65352).
502502
# The valid options are:
503-
# true - Enable optimizations.
503+
# true - Enable optimizations (same as 3).
504504
# false - Disable optimizations.
505505
# 0 - Disable optimizations.
506506
# 1 - Basic optimizations.

compiler/rustc_ast_pretty/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(internal_features)]
33
#![doc(rust_logo)]
44
#![feature(box_patterns)]
5+
#![feature(negative_impls)]
56
#![feature(rustdoc_internals)]
67
// tidy-alphabetical-end
78

compiler/rustc_ast_pretty/src/pp.rs

+38-2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,38 @@ struct BufEntry {
234234
size: isize,
235235
}
236236

237+
// Boxes opened with methods like `Printer::{cbox,ibox}` must be closed with
238+
// `Printer::end`. Failure to do so can result in bad indenting, or in extreme
239+
// cases, cause no output to be produced at all.
240+
//
241+
// Box opening and closing used to be entirely implicit, which was hard to
242+
// understand and easy to get wrong. This marker type is now returned from the
243+
// box opening methods and forgotten by `Printer::end`. Any marker that isn't
244+
// forgotten will trigger a panic in `drop`. (Closing a box more than once
245+
// isn't possible because `BoxMarker` doesn't implement `Copy` or `Clone`.)
246+
//
247+
// FIXME(nnethercote): the panic in `drop` is currently disabled because a few
248+
// places fail to close their boxes. It can be enabled once they are fixed.
249+
//
250+
// Note: it would be better to make open/close mismatching impossible and avoid
251+
// the need for this marker type altogether by having functions like
252+
// `with_ibox` that open a box, call a closure, and then close the box. That
253+
// would work for simple cases, but box lifetimes sometimes interact with
254+
// complex control flow and across function boundaries in ways that are
255+
// difficult to handle with such a technique.
256+
#[must_use]
257+
pub struct BoxMarker;
258+
259+
impl !Clone for BoxMarker {}
260+
impl !Copy for BoxMarker {}
261+
262+
impl Drop for BoxMarker {
263+
fn drop(&mut self) {
264+
// FIXME(nnethercote): enable once the bad cases are fixed
265+
//panic!("BoxMarker not ended with `Printer::end()`");
266+
}
267+
}
268+
237269
impl Printer {
238270
pub fn new() -> Self {
239271
Printer {
@@ -270,23 +302,27 @@ impl Printer {
270302
}
271303
}
272304

273-
fn scan_begin(&mut self, token: BeginToken) {
305+
// This is is where `BoxMarker`s are produced.
306+
fn scan_begin(&mut self, token: BeginToken) -> BoxMarker {
274307
if self.scan_stack.is_empty() {
275308
self.left_total = 1;
276309
self.right_total = 1;
277310
self.buf.clear();
278311
}
279312
let right = self.buf.push(BufEntry { token: Token::Begin(token), size: -self.right_total });
280313
self.scan_stack.push_back(right);
314+
BoxMarker
281315
}
282316

283-
fn scan_end(&mut self) {
317+
// This is is where `BoxMarker`s are consumed.
318+
fn scan_end(&mut self, b: BoxMarker) {
284319
if self.scan_stack.is_empty() {
285320
self.print_end();
286321
} else {
287322
let right = self.buf.push(BufEntry { token: Token::End, size: -1 });
288323
self.scan_stack.push_back(right);
289324
}
325+
std::mem::forget(b)
290326
}
291327

292328
fn scan_break(&mut self, token: BreakToken) {

compiler/rustc_ast_pretty/src/pp/convenience.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
use std::borrow::Cow;
22

3-
use crate::pp::{BeginToken, BreakToken, Breaks, IndentStyle, Printer, SIZE_INFINITY, Token};
3+
use crate::pp::{
4+
BeginToken, BoxMarker, BreakToken, Breaks, IndentStyle, Printer, SIZE_INFINITY, Token,
5+
};
46

57
impl Printer {
68
/// "raw box"
7-
pub fn rbox(&mut self, indent: isize, breaks: Breaks) {
9+
pub fn rbox(&mut self, indent: isize, breaks: Breaks) -> BoxMarker {
810
self.scan_begin(BeginToken { indent: IndentStyle::Block { offset: indent }, breaks })
911
}
1012

1113
/// Inconsistent breaking box
12-
pub fn ibox(&mut self, indent: isize) {
14+
pub fn ibox(&mut self, indent: isize) -> BoxMarker {
1315
self.rbox(indent, Breaks::Inconsistent)
1416
}
1517

1618
/// Consistent breaking box
17-
pub fn cbox(&mut self, indent: isize) {
19+
pub fn cbox(&mut self, indent: isize) -> BoxMarker {
1820
self.rbox(indent, Breaks::Consistent)
1921
}
2022

21-
pub fn visual_align(&mut self) {
22-
self.scan_begin(BeginToken { indent: IndentStyle::Visual, breaks: Breaks::Consistent });
23+
pub fn visual_align(&mut self) -> BoxMarker {
24+
self.scan_begin(BeginToken { indent: IndentStyle::Visual, breaks: Breaks::Consistent })
2325
}
2426

2527
pub fn break_offset(&mut self, n: usize, off: isize) {
@@ -30,8 +32,8 @@ impl Printer {
3032
});
3133
}
3234

33-
pub fn end(&mut self) {
34-
self.scan_end()
35+
pub fn end(&mut self, b: BoxMarker) {
36+
self.scan_end(b)
3537
}
3638

3739
pub fn eof(mut self) -> String {

0 commit comments

Comments
 (0)