Skip to content

Commit b724fab

Browse files
authored
Merge pull request #4227 from rust-lang/rustup-2025-03-15
Automatic Rustup
2 parents 0b643df + 39df7ee commit b724fab

File tree

84 files changed

+1272
-464
lines changed

Some content is hidden

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

84 files changed

+1272
-464
lines changed

.github/workflows/ci.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
timeout-minutes: 360
6969
env:
7070
CI_JOB_NAME: ${{ matrix.name }}
71+
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
7172
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
7273
# commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
7374
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -190,8 +191,20 @@ jobs:
190191
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
191192
192193
- name: run the build
193-
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
194-
run: src/ci/scripts/run-build-from-ci.sh 2>&1
194+
run: |
195+
set +e
196+
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
197+
src/ci/scripts/run-build-from-ci.sh 2>&1
198+
STATUS=$?
199+
set -e
200+
201+
if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
202+
echo "****************************************************************************"
203+
echo "To find more information about this job, visit the following URL:"
204+
echo "$CI_JOB_DOC_URL"
205+
echo "****************************************************************************"
206+
fi
207+
exit ${STATUS}
195208
env:
196209
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
197210
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}

Cargo.lock

+4
Original file line numberDiff line numberDiff line change
@@ -6438,6 +6438,10 @@ version = "0.5.5"
64386438
source = "registry+https://github.com/rust-lang/crates.io-index"
64396439
checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
64406440

6441+
[[package]]
6442+
name = "x"
6443+
version = "0.1.1"
6444+
64416445
[[package]]
64426446
name = "xattr"
64436447
version = "1.4.0"

Cargo.toml

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
[workspace]
22
resolver = "2"
33
members = [
4+
# tidy-alphabetical-start
45
"compiler/rustc",
56
"src/build_helper",
67
"src/etc/test-float-parse",
7-
"src/rustc-std-workspace/rustc-std-workspace-core",
88
"src/rustc-std-workspace/rustc-std-workspace-alloc",
9+
"src/rustc-std-workspace/rustc-std-workspace-core",
910
"src/rustc-std-workspace/rustc-std-workspace-std",
1011
"src/rustdoc-json-types",
12+
"src/tools/build-manifest",
13+
"src/tools/bump-stage0",
1114
"src/tools/cargotest",
1215
"src/tools/clippy",
1316
"src/tools/clippy/clippy_dev",
17+
"src/tools/collect-license-metadata",
1418
"src/tools/compiletest",
15-
"src/tools/run-make-support",
19+
"src/tools/coverage-dump",
20+
"src/tools/features-status-dump",
21+
"src/tools/generate-copyright",
22+
"src/tools/generate-windows-sys",
23+
"src/tools/html-checker",
24+
"src/tools/jsondocck",
25+
"src/tools/jsondoclint",
1626
"src/tools/linkchecker",
1727
"src/tools/lint-docs",
28+
"src/tools/lld-wrapper",
29+
"src/tools/llvm-bitcode-linker",
30+
"src/tools/miri",
31+
"src/tools/miri/cargo-miri",
1832
"src/tools/miropt-test-tools",
19-
"src/tools/unstable-book-gen",
20-
"src/tools/tidy",
21-
"src/tools/tier-check",
22-
"src/tools/build-manifest",
33+
"src/tools/opt-dist",
2334
"src/tools/remote-test-client",
2435
"src/tools/remote-test-server",
36+
"src/tools/replace-version-placeholder",
37+
"src/tools/run-make-support",
2538
"src/tools/rust-installer",
2639
"src/tools/rustdoc",
27-
"src/tools/rustfmt",
28-
"src/tools/miri",
29-
"src/tools/miri/cargo-miri",
40+
"src/tools/rustdoc-gui-test",
3041
"src/tools/rustdoc-themes",
31-
"src/tools/unicode-table-generator",
32-
"src/tools/jsondocck",
33-
"src/tools/jsondoclint",
34-
"src/tools/llvm-bitcode-linker",
35-
"src/tools/html-checker",
36-
"src/tools/bump-stage0",
37-
"src/tools/replace-version-placeholder",
38-
"src/tools/lld-wrapper",
39-
"src/tools/collect-license-metadata",
40-
"src/tools/generate-copyright",
42+
"src/tools/rustfmt",
4143
"src/tools/suggest-tests",
42-
"src/tools/generate-windows-sys",
43-
"src/tools/rustdoc-gui-test",
44-
"src/tools/opt-dist",
45-
"src/tools/coverage-dump",
44+
"src/tools/tidy",
45+
"src/tools/tier-check",
46+
"src/tools/unicode-table-generator",
47+
"src/tools/unstable-book-gen",
4648
"src/tools/wasm-component-ld",
47-
"src/tools/features-status-dump",
49+
"src/tools/x",
50+
# tidy-alphabetical-end
4851
]
4952

5053
exclude = [
@@ -55,11 +58,6 @@ exclude = [
5558
"tests/rustdoc-gui",
5659
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
5760
"obj",
58-
# The `x` binary is a thin wrapper that calls `x.py`, which initializes
59-
# submodules, before which workspace members cannot be invoked because
60-
# not all `Cargo.toml` files are available, so we exclude the `x` binary,
61-
# so it can be invoked before the current checkout is set up.
62-
"src/tools/x",
6361
]
6462

6563
[profile.release.package.rustc-rayon-core]

compiler/rustc_ast/src/ast.rs

+39-1
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ pub enum ExprKind {
16571657
Try(P<Expr>),
16581658

16591659
/// A `yield`, with an optional value to be yielded.
1660-
Yield(Option<P<Expr>>),
1660+
Yield(YieldKind),
16611661

16621662
/// A `do yeet` (aka `throw`/`fail`/`bail`/`raise`/whatever),
16631663
/// with an optional value to be returned.
@@ -1903,6 +1903,44 @@ pub enum MatchKind {
19031903
Postfix,
19041904
}
19051905

1906+
/// The kind of yield expression
1907+
#[derive(Clone, Encodable, Decodable, Debug)]
1908+
pub enum YieldKind {
1909+
/// yield expr { ... }
1910+
Prefix(Option<P<Expr>>),
1911+
/// expr.yield { ... }
1912+
Postfix(P<Expr>),
1913+
}
1914+
1915+
impl YieldKind {
1916+
/// Returns the expression inside the yield expression, if any.
1917+
///
1918+
/// For postfix yields, this is guaranteed to be `Some`.
1919+
pub const fn expr(&self) -> Option<&P<Expr>> {
1920+
match self {
1921+
YieldKind::Prefix(expr) => expr.as_ref(),
1922+
YieldKind::Postfix(expr) => Some(expr),
1923+
}
1924+
}
1925+
1926+
/// Returns a mutable reference to the expression being yielded, if any.
1927+
pub const fn expr_mut(&mut self) -> Option<&mut P<Expr>> {
1928+
match self {
1929+
YieldKind::Prefix(expr) => expr.as_mut(),
1930+
YieldKind::Postfix(expr) => Some(expr),
1931+
}
1932+
}
1933+
1934+
/// Returns true if both yields are prefix or both are postfix.
1935+
pub const fn same_kind(&self, other: &Self) -> bool {
1936+
match (self, other) {
1937+
(YieldKind::Prefix(_), YieldKind::Prefix(_)) => true,
1938+
(YieldKind::Postfix(_), YieldKind::Postfix(_)) => true,
1939+
_ => false,
1940+
}
1941+
}
1942+
}
1943+
19061944
/// A literal in a meta item.
19071945
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)]
19081946
pub struct MetaItemLit {

compiler/rustc_ast/src/mut_visit.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1813,8 +1813,11 @@ pub fn walk_expr<T: MutVisitor>(vis: &mut T, Expr { kind, id, span, attrs, token
18131813
ExprKind::Paren(expr) => {
18141814
vis.visit_expr(expr);
18151815
}
1816-
ExprKind::Yield(expr) => {
1817-
visit_opt(expr, |expr| vis.visit_expr(expr));
1816+
ExprKind::Yield(kind) => {
1817+
let expr = kind.expr_mut();
1818+
if let Some(expr) = expr {
1819+
vis.visit_expr(expr);
1820+
}
18181821
}
18191822
ExprKind::Try(expr) => vis.visit_expr(expr),
18201823
ExprKind::TryBlock(body) => vis.visit_block(body),

compiler/rustc_ast/src/util/classify.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,14 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
182182
| Range(_, Some(e), _)
183183
| Ret(Some(e))
184184
| Unary(_, e)
185-
| Yield(Some(e))
186185
| Yeet(Some(e))
187186
| Become(e) => {
188187
expr = e;
189188
}
189+
Yield(kind) => match kind.expr() {
190+
Some(e) => expr = e,
191+
None => break None,
192+
},
190193
Closure(closure) => {
191194
expr = &closure.body;
192195
}
@@ -217,7 +220,6 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
217220
Break(_, None)
218221
| Range(_, None, _)
219222
| Ret(None)
220-
| Yield(None)
221223
| Array(_)
222224
| Call(_, _)
223225
| MethodCall(_)
@@ -237,7 +239,9 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
237239
| Yeet(None)
238240
| UnsafeBinderCast(..)
239241
| Err(_)
240-
| Dummy => break None,
242+
| Dummy => {
243+
break None;
244+
}
241245
}
242246
}
243247
}

compiler/rustc_ast/src/visit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,8 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
12691269
try_visit!(visitor.visit_ty(container));
12701270
walk_list!(visitor, visit_ident, fields.iter());
12711271
}
1272-
ExprKind::Yield(optional_expression) => {
1273-
visit_opt!(visitor, visit_expr, optional_expression);
1272+
ExprKind::Yield(kind) => {
1273+
visit_opt!(visitor, visit_expr, kind.expr());
12741274
}
12751275
ExprKind::Try(subexpression) => try_visit!(visitor.visit_expr(subexpression)),
12761276
ExprKind::TryBlock(body) => try_visit!(visitor.visit_block(body)),

compiler/rustc_ast_lowering/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
351351
rest,
352352
)
353353
}
354-
ExprKind::Yield(opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
354+
ExprKind::Yield(kind) => self.lower_expr_yield(e.span, kind.expr().map(|x| &**x)),
355355
ExprKind::Err(guar) => hir::ExprKind::Err(*guar),
356356

357357
ExprKind::UnsafeBinderCast(kind, expr, ty) => hir::ExprKind::UnsafeBinderCast(

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_ast::util::literal::escape_byte_str_symbol;
88
use rustc_ast::util::parser::{self, ExprPrecedence, Fixity};
99
use rustc_ast::{
1010
self as ast, BlockCheckMode, FormatAlignment, FormatArgPosition, FormatArgsPiece, FormatCount,
11-
FormatDebugHex, FormatSign, FormatTrait, token,
11+
FormatDebugHex, FormatSign, FormatTrait, YieldKind, token,
1212
};
1313

1414
use crate::pp::Breaks::Inconsistent;
@@ -761,7 +761,7 @@ impl<'a> State<'a> {
761761
self.print_expr(e, FixupContext::default());
762762
self.pclose();
763763
}
764-
ast::ExprKind::Yield(e) => {
764+
ast::ExprKind::Yield(YieldKind::Prefix(e)) => {
765765
self.word("yield");
766766

767767
if let Some(expr) = e {
@@ -773,6 +773,14 @@ impl<'a> State<'a> {
773773
);
774774
}
775775
}
776+
ast::ExprKind::Yield(YieldKind::Postfix(e)) => {
777+
self.print_expr_cond_paren(
778+
e,
779+
e.precedence() < ExprPrecedence::Unambiguous,
780+
fixup.leftmost_subexpression_with_dot(),
781+
);
782+
self.word(".yield");
783+
}
776784
ast::ExprKind::Try(e) => {
777785
self.print_expr_cond_paren(
778786
e,

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10311031

10321032
let layout = src.layout();
10331033
match layout.ty.kind() {
1034-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1034+
ty::Int(_) => {}
10351035
_ => {
10361036
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10371037
return Ok(());
@@ -1052,7 +1052,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10521052

10531053
let layout = src.layout();
10541054
match layout.ty.kind() {
1055-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1055+
ty::Uint(_) => {}
10561056
_ => {
10571057
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10581058
return Ok(());
@@ -1073,7 +1073,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10731073

10741074
let layout = src.layout();
10751075
match layout.ty.kind() {
1076-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1076+
ty::Int(_) => {}
10771077
_ => {
10781078
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10791079
return Ok(());
@@ -1094,7 +1094,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10941094

10951095
let layout = src.layout();
10961096
match layout.ty.kind() {
1097-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1097+
ty::Uint(_) => {}
10981098
_ => {
10991099
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
11001100
return Ok(());

compiler/rustc_codegen_ssa/src/back/command.rs

-7
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ impl Command {
143143
return false;
144144
}
145145

146-
// Right now LLD doesn't support the `@` syntax of passing an argument
147-
// through files, so regardless of the platform we try to go to the OS
148-
// on this one.
149-
if let Program::Lld(..) = self.program {
150-
return false;
151-
}
152-
153146
// Ok so on Windows to spawn a process is 32,768 characters in its
154147
// command line [1]. Unfortunately we don't actually have access to that
155148
// as it's calculated just before spawning. Instead we perform a

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

+34-4
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,40 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
433433
}
434434

435435
// These are all AtomicRMW ops
436+
"max" | "min" => {
437+
let atom_op = if instruction == "max" {
438+
AtomicRmwBinOp::AtomicMax
439+
} else {
440+
AtomicRmwBinOp::AtomicMin
441+
};
442+
443+
let ty = fn_args.type_at(0);
444+
if matches!(ty.kind(), ty::Int(_)) {
445+
let ptr = args[0].immediate();
446+
let val = args[1].immediate();
447+
bx.atomic_rmw(atom_op, ptr, val, parse_ordering(bx, ordering))
448+
} else {
449+
invalid_monomorphization(ty);
450+
return Ok(());
451+
}
452+
}
453+
"umax" | "umin" => {
454+
let atom_op = if instruction == "umax" {
455+
AtomicRmwBinOp::AtomicUMax
456+
} else {
457+
AtomicRmwBinOp::AtomicUMin
458+
};
459+
460+
let ty = fn_args.type_at(0);
461+
if matches!(ty.kind(), ty::Uint(_)) {
462+
let ptr = args[0].immediate();
463+
let val = args[1].immediate();
464+
bx.atomic_rmw(atom_op, ptr, val, parse_ordering(bx, ordering))
465+
} else {
466+
invalid_monomorphization(ty);
467+
return Ok(());
468+
}
469+
}
436470
op => {
437471
let atom_op = match op {
438472
"xchg" => AtomicRmwBinOp::AtomicXchg,
@@ -442,10 +476,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
442476
"nand" => AtomicRmwBinOp::AtomicNand,
443477
"or" => AtomicRmwBinOp::AtomicOr,
444478
"xor" => AtomicRmwBinOp::AtomicXor,
445-
"max" => AtomicRmwBinOp::AtomicMax,
446-
"min" => AtomicRmwBinOp::AtomicMin,
447-
"umax" => AtomicRmwBinOp::AtomicUMax,
448-
"umin" => AtomicRmwBinOp::AtomicUMin,
449479
_ => bx.sess().dcx().emit_fatal(errors::UnknownAtomicOperation),
450480
};
451481

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,8 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
18401840
let ty = self.pat_ty_adjusted(subpat)?;
18411841
let ty = Ty::new_ref(self.cx.tcx(), re_erased, ty, mutability);
18421842
// A deref pattern generates a temporary.
1843-
let place = self.cat_rvalue(pat.hir_id, ty);
1843+
let base = self.cat_rvalue(pat.hir_id, ty);
1844+
let place = self.cat_deref(pat.hir_id, base)?;
18441845
self.cat_pattern(place, subpat, op)?;
18451846
}
18461847

0 commit comments

Comments
 (0)