Skip to content

Commit a5b98c7

Browse files
authored
Merge branch 'rust-lang:master' into issue-137421
2 parents ef032c7 + 2c6a12e commit a5b98c7

File tree

1,728 files changed

+27663
-21043
lines changed

Some content is hidden

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

1,728 files changed

+27663
-21043
lines changed

.github/workflows/ci.yml

+18-19
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
5959
run: |
6060
cd src/ci/citool
61-
cargo test
62-
cargo run calculate-job-matrix >> $GITHUB_OUTPUT
61+
CARGO_INCREMENTAL=0 cargo test
62+
CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT
6363
id: jobs
6464
job:
6565
name: ${{ matrix.full_name }}
@@ -182,19 +182,12 @@ jobs:
182182
- name: show the current environment
183183
run: src/ci/scripts/dump-environment.sh
184184

185-
# Temporary fix to unblock CI
186-
# Remove the latest Windows SDK for 32-bit Windows MSVC builds.
187-
# See issue https://github.com/rust-lang/rust/issues/137733 for more details.
188-
- name: Remove Windows SDK 10.0.26100.0
189-
shell: powershell
190-
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
191188
run: |
192-
$kits = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots').KitsRoot10
193-
$sdk_version = "10.0.26100.0"
194-
195-
foreach ($kind in 'Bin', 'Lib', 'Include') {
196-
Remove-Item -Force -Recurse $kits\$kind\$sdk_version -ErrorAction Continue
197-
}
189+
cd src/ci/citool
190+
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
198191
199192
- name: run the build
200193
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
@@ -232,16 +225,22 @@ jobs:
232225
# erroring about invalid credentials instead.
233226
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
234227

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+
235238
- name: upload job metrics to DataDog
236239
if: needs.calculate_matrix.outputs.run_type != 'pr'
237240
env:
238-
DATADOG_SITE: datadoghq.com
239241
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
240242
DD_GITHUB_JOB_NAME: ${{ matrix.full_name }}
241-
run: |
242-
cd src/ci
243-
npm ci
244-
python3 scripts/upload-build-metrics.py ../../build/cpu-usage.csv
243+
run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
245244

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

.github/workflows/post-merge.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
- name: Perform analysis and send PR
20+
run: |
21+
# Get closest bors merge commit
22+
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
23+
24+
# Find PR for the current commit
25+
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
26+
27+
echo "Parent: ${PARENT_COMMIT}"
28+
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
29+
30+
cd src/ci/citool
31+
32+
echo "Post-merge analysis result" > output.log
33+
cargo run --release post-merge-analysis ${PARENT_COMMIT} ${{ github.sha }} >> output.log
34+
cat output.log
35+
36+
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

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

+16-2
Original file line numberDiff line numberDiff line change
@@ -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"
@@ -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",
@@ -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
]
@@ -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",
@@ -5260,6 +5273,7 @@ dependencies = [
52605273
"serde",
52615274
"similar",
52625275
"termcolor",
5276+
"toml 0.7.8",
52635277
"walkdir",
52645278
]
52655279

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ exclude = [
6363
"src/tools/x",
6464
]
6565

66+
# These lints are applied to many crates in the workspace. In practice, this is
67+
# all crates under `compiler/`.
68+
#
69+
# NOTE: rustc-specific lints (e.g. `rustc::internal`) aren't supported by
70+
# Cargo. (Support for them is possibly blocked by #44690 (attributes for
71+
# tools).) Those lints are instead specified for `compiler/` crates in
72+
# `src/bootstrap/src/core/builder/cargo.rs`.
73+
[workspace.lints.rust]
74+
# FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all of the
75+
# individual lints are satisfied.
76+
keyword_idents_2024 = "warn"
77+
unreachable_pub = "warn"
78+
unsafe_op_in_unsafe_fn = "warn"
79+
6680
[profile.release.package.rustc-rayon-core]
6781
# The rustc fork of Rayon has deadlock detection code which intermittently
6882
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)

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/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ llvm = ['rustc_driver_impl/llvm']
3232
max_level_info = ['rustc_driver_impl/max_level_info']
3333
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
3434
# tidy-alphabetical-end
35+
36+
[lints]
37+
workspace = true

compiler/rustc_abi/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ nightly = [
3131
]
3232
randomize = ["dep:rand", "dep:rand_xoshiro", "nightly"]
3333
# tidy-alphabetical-end
34+
35+
[lints]
36+
workspace = true

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)