Skip to content

Commit 5627a78

Browse files
Merge branch 'rust-lang:master' into compiler
2 parents d4190be + ebf0cf7 commit 5627a78

File tree

4,657 files changed

+72038
-41201
lines changed

Some content is hidden

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

4,657 files changed

+72038
-41201
lines changed

.github/workflows/ci.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This file defines our primary CI workflow that runs on pull requests
22
# and also on pushes to special branches (auto, try).
33
#
4-
# The actual definition of the executed jobs is calculated by a Python
5-
# script located at src/ci/github-actions/ci.py, which
4+
# The actual definition of the executed jobs is calculated by the
5+
# `src/ci/citool` crate, which
66
# uses job definition data from src/ci/github-actions/jobs.yml.
77
# You should primarily modify the `jobs.yml` file if you want to modify
88
# what jobs are executed in CI.
@@ -56,7 +56,10 @@ jobs:
5656
- name: Calculate the CI job matrix
5757
env:
5858
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
59-
run: python3 src/ci/github-actions/ci.py calculate-job-matrix >> $GITHUB_OUTPUT
59+
run: |
60+
cd src/ci/citool
61+
CARGO_INCREMENTAL=0 cargo test
62+
CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT
6063
id: jobs
6164
job:
6265
name: ${{ matrix.full_name }}
@@ -179,19 +182,12 @@ jobs:
179182
- name: show the current environment
180183
run: src/ci/scripts/dump-environment.sh
181184

182-
# Temporary fix to unblock CI
183-
# Remove the latest Windows SDK for 32-bit Windows MSVC builds.
184-
# See issue https://github.com/rust-lang/rust/issues/137733 for more details.
185-
- name: Remove Windows SDK 10.0.26100.0
186-
shell: powershell
187-
if: ${{ matrix.name == 'i686-msvc-1' || matrix.name == 'i686-msvc-2' || matrix.name == 'dist-i686-msvc' }}
185+
# Pre-build citool before the following step uninstalls rustup
186+
# Build it into the build directory, to avoid modifying sources
187+
- name: build citool
188188
run: |
189-
$kits = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots').KitsRoot10
190-
$sdk_version = "10.0.26100.0"
191-
192-
foreach ($kind in 'Bin', 'Lib', 'Include') {
193-
Remove-Item -Force -Recurse $kits\$kind\$sdk_version -ErrorAction Continue
194-
}
189+
cd src/ci/citool
190+
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
195191
196192
- name: run the build
197193
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
@@ -229,16 +225,22 @@ jobs:
229225
# erroring about invalid credentials instead.
230226
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
231227

228+
- name: postprocess metrics into the summary
229+
run: |
230+
if [ -f build/metrics.json ]; then
231+
./build/citool/debug/citool postprocess-metrics build/metrics.json ${GITHUB_STEP_SUMMARY}
232+
elif [ -f obj/build/metrics.json ]; then
233+
./build/citool/debug/citool postprocess-metrics obj/build/metrics.json ${GITHUB_STEP_SUMMARY}
234+
else
235+
echo "No metrics.json found"
236+
fi
237+
232238
- name: upload job metrics to DataDog
233239
if: needs.calculate_matrix.outputs.run_type != 'pr'
234240
env:
235-
DATADOG_SITE: datadoghq.com
236241
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
237242
DD_GITHUB_JOB_NAME: ${{ matrix.full_name }}
238-
run: |
239-
cd src/ci
240-
npm ci
241-
python3 scripts/upload-build-metrics.py ../../build/cpu-usage.csv
243+
run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
242244

243245
# This job isused to tell bors the final status of the build, as there is no practical way to detect
244246
# when a workflow is successful listening to webhooks only in our current bors implementation (homu).

.github/workflows/post-merge.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Workflow that runs after a merge to master, analyses changes in test executions
2+
# and posts the result to the merged PR.
3+
4+
name: Post merge analysis
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
analysis:
13+
runs-on: ubuntu-24.04
14+
if: github.repository == 'rust-lang/rust'
15+
permissions:
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
# Make sure that we have enough commits to find the parent merge commit.
21+
# Since all merges should be through merge commits, fetching two commits
22+
# should be enough to get the parent bors merge commit.
23+
fetch-depth: 2
24+
- name: Perform analysis and send PR
25+
env:
26+
GH_TOKEN: ${{ github.token }}
27+
run: |
28+
# Get closest bors merge commit
29+
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
30+
echo "Parent: ${PARENT_COMMIT}"
31+
32+
# Find PR for the current commit
33+
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
34+
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
35+
36+
cd src/ci/citool
37+
38+
echo "Post-merge analysis result" > output.log
39+
cargo run --release post-merge-analysis ${PARENT_COMMIT} ${{ github.sha }} >> output.log
40+
cat output.log
41+
42+
gh pr comment ${HEAD_PR} -F output.log

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ no_llvm_build
5353
/target
5454
/library/target
5555
/src/bootstrap/target
56+
/src/ci/citool/target
5657
/src/tools/x/target
5758
# Created by `x vendor`
5859
/vendor

.mailmap

+3
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ James Hinshelwood <jameshinshelwood1@gmail.com> <james.hinshelwood@bigpayme.com>
292292
James Miller <bladeon@gmail.com> <james@aatch.net>
293293
James Perry <james.austin.perry@gmail.com>
294294
James Sanderson <zofrex@gmail.com>
295+
Jana Dönszelmann <jana@donsz.nl>
296+
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
297+
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
295298
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
296299
Jaro Fietz <jaro.fietz@gmx.de>
297300
Jason Fager <jfager@gmail.com>

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For submodules, changes need to be made against the repository corresponding the
1818
submodule, and not the main `rust-lang/rust` repository.
1919

2020
For subtrees, prefer sending a PR against the subtree's repository if it does
21-
not need to be made against the main `rust-lang/rust` repostory (e.g. a
21+
not need to be made against the main `rust-lang/rust` repository (e.g. a
2222
rustc-dev-guide change that does not accompany a compiler change).
2323

2424
## About the [rustc-dev-guide]

Cargo.lock

+33-17
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ dependencies = [
358358
"cargo_metadata 0.18.1",
359359
"directories",
360360
"rustc-build-sysroot",
361-
"rustc_tools_util",
361+
"rustc_tools_util 0.4.0",
362362
"rustc_version",
363363
"serde",
364364
"serde_json",
@@ -522,7 +522,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
522522

523523
[[package]]
524524
name = "clippy"
525-
version = "0.1.86"
525+
version = "0.1.87"
526526
dependencies = [
527527
"anstream",
528528
"cargo_metadata 0.18.1",
@@ -539,7 +539,7 @@ dependencies = [
539539
"quote",
540540
"regex",
541541
"rinja",
542-
"rustc_tools_util",
542+
"rustc_tools_util 0.4.2",
543543
"serde",
544544
"serde_json",
545545
"syn 2.0.96",
@@ -553,7 +553,7 @@ dependencies = [
553553

554554
[[package]]
555555
name = "clippy_config"
556-
version = "0.1.86"
556+
version = "0.1.87"
557557
dependencies = [
558558
"clippy_utils",
559559
"itertools",
@@ -578,7 +578,7 @@ dependencies = [
578578

579579
[[package]]
580580
name = "clippy_lints"
581-
version = "0.1.86"
581+
version = "0.1.87"
582582
dependencies = [
583583
"arrayvec",
584584
"cargo_metadata 0.18.1",
@@ -601,7 +601,7 @@ dependencies = [
601601

602602
[[package]]
603603
name = "clippy_utils"
604-
version = "0.1.86"
604+
version = "0.1.87"
605605
dependencies = [
606606
"arrayvec",
607607
"itertools",
@@ -2526,6 +2526,16 @@ version = "0.2.0"
25262526
source = "registry+https://github.com/rust-lang/crates.io-index"
25272527
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
25282528

2529+
[[package]]
2530+
name = "os_pipe"
2531+
version = "1.2.1"
2532+
source = "registry+https://github.com/rust-lang/crates.io-index"
2533+
checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982"
2534+
dependencies = [
2535+
"libc",
2536+
"windows-sys 0.59.0",
2537+
]
2538+
25292539
[[package]]
25302540
name = "overload"
25312541
version = "0.1.1"
@@ -2871,11 +2881,11 @@ dependencies = [
28712881

28722882
[[package]]
28732883
name = "rand_xoshiro"
2874-
version = "0.6.0"
2884+
version = "0.7.0"
28752885
source = "registry+https://github.com/rust-lang/crates.io-index"
2876-
checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
2886+
checksum = "f703f4665700daf5512dcca5f43afa6af89f09db47fb56be587f80636bda2d41"
28772887
dependencies = [
2878-
"rand_core 0.6.4",
2888+
"rand_core 0.9.0",
28792889
]
28802890

28812891
[[package]]
@@ -3050,6 +3060,7 @@ dependencies = [
30503060
"gimli 0.31.1",
30513061
"libc",
30523062
"object 0.36.7",
3063+
"os_pipe",
30533064
"regex",
30543065
"serde_json",
30553066
"similar",
@@ -3144,7 +3155,7 @@ name = "rustc_abi"
31443155
version = "0.0.0"
31453156
dependencies = [
31463157
"bitflags",
3147-
"rand 0.8.5",
3158+
"rand 0.9.0",
31483159
"rand_xoshiro",
31493160
"rustc_data_structures",
31503161
"rustc_hashes",
@@ -3286,6 +3297,7 @@ dependencies = [
32863297
"rustc_hir",
32873298
"rustc_lexer",
32883299
"rustc_macros",
3300+
"rustc_middle",
32893301
"rustc_serialize",
32903302
"rustc_session",
32913303
"rustc_span",
@@ -3741,7 +3753,7 @@ dependencies = [
37413753
"rustc_abi",
37423754
"rustc_ast",
37433755
"rustc_ast_pretty",
3744-
"rustc_attr_parsing",
3756+
"rustc_attr_data_structures",
37453757
"rustc_hir",
37463758
"rustc_span",
37473759
]
@@ -3777,7 +3789,7 @@ dependencies = [
37773789
name = "rustc_incremental"
37783790
version = "0.0.0"
37793791
dependencies = [
3780-
"rand 0.8.5",
3792+
"rand 0.9.0",
37813793
"rustc_ast",
37823794
"rustc_data_structures",
37833795
"rustc_errors",
@@ -4009,7 +4021,8 @@ dependencies = [
40094021
"rustc_apfloat",
40104022
"rustc_arena",
40114023
"rustc_ast",
4012-
"rustc_attr_parsing",
4024+
"rustc_ast_ir",
4025+
"rustc_attr_data_structures",
40134026
"rustc_data_structures",
40144027
"rustc_error_messages",
40154028
"rustc_errors",
@@ -4454,6 +4467,10 @@ version = "0.4.0"
44544467
source = "registry+https://github.com/rust-lang/crates.io-index"
44554468
checksum = "3316159ab19e19d1065ecc49278e87f767a9dae9fae80348d2b4d4fa4ae02d4d"
44564469

4470+
[[package]]
4471+
name = "rustc_tools_util"
4472+
version = "0.4.2"
4473+
44574474
[[package]]
44584475
name = "rustc_trait_selection"
44594476
version = "0.0.0"
@@ -4501,8 +4518,6 @@ dependencies = [
45014518
"rustc_abi",
45024519
"rustc_data_structures",
45034520
"rustc_hir",
4504-
"rustc_infer",
4505-
"rustc_macros",
45064521
"rustc_middle",
45074522
"rustc_span",
45084523
"tracing",
@@ -5161,8 +5176,8 @@ version = "0.1.0"
51615176
dependencies = [
51625177
"indicatif",
51635178
"num",
5164-
"rand 0.8.5",
5165-
"rand_chacha 0.3.1",
5179+
"rand 0.9.0",
5180+
"rand_chacha 0.9.0",
51665181
"rayon",
51675182
]
51685183

@@ -5258,6 +5273,7 @@ dependencies = [
52585273
"serde",
52595274
"similar",
52605275
"termcolor",
5276+
"toml 0.7.8",
52615277
"walkdir",
52625278
]
52635279

INSTALL.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,13 @@ itself back on after some time).
210210

211211
### MSVC
212212

213-
MSVC builds of Rust additionally require an installation of Visual Studio 2017
214-
(or later) so `rustc` can use its linker. The simplest way is to get
215-
[Visual Studio], check the "C++ build tools" and "Windows 10 SDK" workload.
213+
MSVC builds of Rust additionally requires an installation of:
214+
215+
- Visual Studio 2022 (or later) build tools so `rustc` can use its linker. Older
216+
Visual Studio versions such as 2019 *may* work but aren't actively tested.
217+
- A recent Windows 10 or 11 SDK.
218+
219+
The simplest way is to get [Visual Studio], check the "C++ build tools".
216220

217221
[Visual Studio]: https://visualstudio.microsoft.com/downloads/
218222

compiler/rustc_abi/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ edition = "2024"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
rand = { version = "0.8.4", default-features = false, optional = true }
10-
rand_xoshiro = { version = "0.6.0", optional = true }
11-
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
9+
rand = { version = "0.9.0", default-features = false, optional = true }
10+
rand_xoshiro = { version = "0.7.0", optional = true }
11+
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
1212
rustc_hashes = { path = "../rustc_hashes" }
1313
rustc_index = { path = "../rustc_index", default-features = false }
1414
rustc_macros = { path = "../rustc_macros", optional = true }
15-
rustc_serialize = { path = "../rustc_serialize", optional = true }
15+
rustc_serialize = { path = "../rustc_serialize", optional = true }
1616
rustc_span = { path = "../rustc_span", optional = true }
1717
tracing = "0.1"
1818
# tidy-alphabetical-end

compiler/rustc_abi/src/callconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
7474
Ok(HomogeneousAggregate::Homogeneous(Reg { kind, size: self.size }))
7575
}
7676

77-
BackendRepr::Vector { .. } => {
77+
BackendRepr::SimdVector { .. } => {
7878
assert!(!self.is_zst());
7979
Ok(HomogeneousAggregate::Homogeneous(Reg {
8080
kind: RegKind::Vector,

compiler/rustc_abi/src/extern_abi.rs

+11
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ impl StableOrd for ExternAbi {
191191
}
192192

193193
impl ExternAbi {
194+
/// An ABI "like Rust"
195+
///
196+
/// These ABIs are fully controlled by the Rust compiler, which means they
197+
/// - support unwinding with `-Cpanic=unwind`, unlike `extern "C"`
198+
/// - often diverge from the C ABI
199+
/// - are subject to change between compiler versions
200+
pub fn is_rustic_abi(self) -> bool {
201+
use ExternAbi::*;
202+
matches!(self, Rust | RustCall | RustIntrinsic | RustCold)
203+
}
204+
194205
pub fn supports_varargs(self) -> bool {
195206
// * C and Cdecl obviously support varargs.
196207
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.

0 commit comments

Comments
 (0)