Skip to content

Commit 076ec59

Browse files
committed
Auto merge of #142081 - matthiaskrgr:rollup-secpezz, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #141709 (jsondocck: Refactor directive handling) - #141974 (`tests/ui`: A New Order [4/N]) - #141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately) - #142015 (Report the actual item that evaluation failed for) - #142026 (bootstrap: Fix file permissions when dereferencing symlinks) - #142032 (Fix parsing of frontmatters with inner hyphens) - #142036 (Update the `compiler-builtins` subtree) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0b20963 + 9a9e160 commit 076ec59

File tree

130 files changed

+1799
-1594
lines changed

Some content is hidden

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

130 files changed

+1799
-1594
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4673,6 +4673,7 @@ dependencies = [
46734673
"bincode",
46744674
"rustc-hash 2.1.1",
46754675
"serde",
4676+
"serde_derive",
46764677
"serde_json",
46774678
]
46784679

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,12 @@ fn report_eval_error<'tcx>(
454454
// FIXME(oli-obk): figure out how to use structured diagnostics again.
455455
diag.code(E0080);
456456
diag.span_label(span, crate::fluent_generated::const_eval_error);
457-
diag.arg("instance", instance);
458-
diag.arg("error_kind", kind);
459457
for frame in frames {
460458
diag.subdiagnostic(frame);
461459
}
460+
// Add after the frame rendering above, as it adds its own `instance` args.
461+
diag.arg("instance", instance);
462+
diag.arg("error_kind", kind);
462463
},
463464
)
464465
}

compiler/rustc_lexer/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,12 @@ impl Cursor<'_> {
545545

546546
let mut s = self.as_str();
547547
let mut found = false;
548+
let mut size = 0;
548549
while let Some(closing) = s.find(&"-".repeat(length_opening as usize)) {
549550
let preceding_chars_start = s[..closing].rfind("\n").map_or(0, |i| i + 1);
550551
if s[preceding_chars_start..closing].chars().all(is_whitespace) {
551552
// candidate found
552-
self.bump_bytes(closing);
553+
self.bump_bytes(size + closing);
553554
// in case like
554555
// ---cargo
555556
// --- blahblah
@@ -562,6 +563,7 @@ impl Cursor<'_> {
562563
break;
563564
} else {
564565
s = &s[closing + length_opening as usize..];
566+
size += closing + length_opening as usize;
565567
}
566568
}
567569

library/compiler-builtins/.github/workflows/main.yaml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55

66
concurrency:
77
# Make sure that new pushes cancel running jobs
8-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
99
cancel-in-progress: true
1010

1111
env:
1212
CARGO_TERM_COLOR: always
1313
RUSTDOCFLAGS: -Dwarnings
1414
RUSTFLAGS: -Dwarnings
1515
RUST_BACKTRACE: full
16-
BENCHMARK_RUSTC: nightly-2025-01-16 # Pin the toolchain for reproducable results
16+
BENCHMARK_RUSTC: nightly-2025-05-28 # Pin the toolchain for reproducable results
1717

1818
jobs:
1919
# Determine which tests should be run based on changed files.
@@ -108,8 +108,6 @@ jobs:
108108
- name: Print runner information
109109
run: uname -a
110110
- uses: actions/checkout@v4
111-
with:
112-
submodules: true
113111
- name: Install Rust (rustup)
114112
shell: bash
115113
run: |
@@ -119,7 +117,6 @@ jobs:
119117
rustup update "$channel" --no-self-update
120118
rustup default "$channel"
121119
rustup target add "${{ matrix.target }}"
122-
rustup component add llvm-tools-preview
123120
- uses: taiki-e/install-action@nextest
124121
- uses: Swatinem/rust-cache@v2
125122
with:
@@ -147,6 +144,10 @@ jobs:
147144
shell: bash
148145
- run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV"
149146
shell: bash
147+
148+
- name: Download musl source
149+
run: ./ci/update-musl.sh
150+
shell: bash
150151

151152
- name: Verify API list
152153
if: matrix.os == 'ubuntu-24.04'
@@ -183,25 +184,29 @@ jobs:
183184
timeout-minutes: 10
184185
steps:
185186
- uses: actions/checkout@v4
186-
with:
187-
submodules: true
188187
# Unlike rustfmt, stable clippy does not work on code with nightly features.
189188
- name: Install nightly `clippy`
190189
run: |
191190
rustup set profile minimal
192191
rustup default nightly
193192
rustup component add clippy
194193
- uses: Swatinem/rust-cache@v2
194+
- name: Download musl source
195+
run: ./ci/update-musl.sh
195196
- run: cargo clippy --workspace --all-targets
196197

197198
benchmarks:
198199
name: Benchmarks
199-
runs-on: ubuntu-24.04
200200
timeout-minutes: 20
201+
strategy:
202+
fail-fast: false
203+
matrix:
204+
include:
205+
- target: x86_64-unknown-linux-gnu
206+
os: ubuntu-24.04
207+
runs-on: ${{ matrix.os }}
201208
steps:
202209
- uses: actions/checkout@master
203-
with:
204-
submodules: true
205210
- uses: taiki-e/install-action@cargo-binstall
206211

207212
- name: Set up dependencies
@@ -216,12 +221,16 @@ jobs:
216221
cargo binstall -y iai-callgrind-runner --version "$iai_version"
217222
sudo apt-get install valgrind
218223
- uses: Swatinem/rust-cache@v2
224+
with:
225+
key: ${{ matrix.target }}
226+
- name: Download musl source
227+
run: ./ci/update-musl.sh
219228

220229
- name: Run icount benchmarks
221230
env:
222231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223232
PR_NUMBER: ${{ github.event.pull_request.number }}
224-
run: ./ci/bench-icount.sh
233+
run: ./ci/bench-icount.sh ${{ matrix.target }}
225234

226235
- name: Upload the benchmark baseline
227236
uses: actions/upload-artifact@v4
@@ -249,8 +258,6 @@ jobs:
249258
timeout-minutes: 10
250259
steps:
251260
- uses: actions/checkout@v4
252-
with:
253-
submodules: true
254261
- name: Install Rust (rustup)
255262
run: rustup update nightly --no-self-update && rustup default nightly
256263
shell: bash
@@ -285,8 +292,6 @@ jobs:
285292
timeout-minutes: 10
286293
steps:
287294
- uses: actions/checkout@v4
288-
with:
289-
submodules: true
290295
- name: Install stable `rustfmt`
291296
run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
292297
- run: cargo fmt -- --check
@@ -310,13 +315,13 @@ jobs:
310315
TO_TEST: ${{ matrix.to_test }}
311316
steps:
312317
- uses: actions/checkout@v4
313-
with:
314-
submodules: true
315318
- name: Install Rust
316319
run: |
317320
rustup update nightly --no-self-update
318321
rustup default nightly
319322
- uses: Swatinem/rust-cache@v2
323+
- name: download musl source
324+
run: ./ci/update-musl.sh
320325
- name: Run extensive tests
321326
run: ./ci/run-extensive.sh
322327
- name: Print test logs if available

library/compiler-builtins/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ iai-home
1414
*.bk
1515
*.rs.bk
1616
.#*
17+
18+
# Manually managed
19+
crates/musl-math-sys/musl

library/compiler-builtins/.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

library/compiler-builtins/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ resolver = "2"
33
members = [
44
"builtins-test",
55
"compiler-builtins",
6+
"crates/josh-sync",
67
"crates/libm-macros",
78
"crates/musl-math-sys",
89
"crates/panic-handler",
10+
"crates/symbol-check",
911
"crates/util",
1012
"libm",
1113
"libm-test",

library/compiler-builtins/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repository contains two main crates:
55
* `compiler-builtins`: symbols that the compiler expects to be available at
66
link time
77
* `libm`: a Rust implementation of C math libraries, used to provide
8-
implementations in `ocre`.
8+
implementations in `core`.
99

1010
More details are at [compiler-builtins/README.md](compiler-builtins/README.md)
1111
and [libm/README.md](libm/README.md).

library/compiler-builtins/builtins-test-intrinsics/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "builtins-test-intrinsics"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66
license = "MIT OR Apache-2.0"
77

88
[dependencies]
9-
compiler_builtins = { path = "../compiler-builtins", features = ["compiler-builtins"]}
9+
compiler_builtins = { path = "../compiler-builtins", features = ["compiler-builtins"] }
1010
panic-handler = { path = "../crates/panic-handler" }
1111

1212
[features]

library/compiler-builtins/builtins-test-intrinsics/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
#![no_std]
1414
#![no_main]
1515

16+
// Ensure this `compiler_builtins` gets used, rather than the version injected from the sysroot.
17+
extern crate compiler_builtins;
1618
extern crate panic_handler;
1719

20+
// SAFETY: no definitions, only used for linking
1821
#[cfg(all(not(thumb), not(windows), not(target_arch = "wasm32")))]
1922
#[link(name = "c")]
20-
extern "C" {}
23+
unsafe extern "C" {}
2124

2225
// Every function in this module maps will be lowered to an intrinsic by LLVM, if the platform
2326
// doesn't have native support for the operation used in the function. ARM has a naming convention
@@ -651,22 +654,23 @@ fn something_with_a_dtor(f: &dyn Fn()) {
651654

652655
#[unsafe(no_mangle)]
653656
#[cfg(not(thumb))]
654-
fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
657+
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
655658
run();
656659
0
657660
}
658661

659662
#[unsafe(no_mangle)]
660663
#[cfg(thumb)]
661-
pub fn _start() -> ! {
664+
extern "C" fn _start() -> ! {
662665
run();
663666
loop {}
664667
}
665668

669+
// SAFETY: no definitions, only used for linking
666670
#[cfg(windows)]
667671
#[link(name = "kernel32")]
668672
#[link(name = "msvcrt")]
669-
extern "C" {}
673+
unsafe extern "C" {}
670674

671675
// ARM targets need these symbols
672676
#[unsafe(no_mangle)]

library/compiler-builtins/builtins-test/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)"
1010
# For fuzzing tests we want a deterministic seedable RNG. We also eliminate potential
1111
# problems with system RNGs on the variety of platforms this crate is tested on.
1212
# `xoshiro128**` is used for its quality, size, and speed at generating `u32` shift amounts.
13-
rand_xoshiro = "0.6"
13+
rand_xoshiro = "0.7"
1414
# To compare float builtins against
15-
rustc_apfloat = "0.2.1"
15+
rustc_apfloat = "0.2.2"
1616
# Really a dev dependency, but dev dependencies can't be optional
17-
iai-callgrind = { version = "0.14.0", optional = true }
17+
iai-callgrind = { version = "0.14.1", optional = true }
1818

1919
[dependencies.compiler_builtins]
2020
path = "../compiler-builtins"
2121
default-features = false
2222
features = ["unstable-public-internals"]
2323

2424
[dev-dependencies]
25-
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }
25+
criterion = { version = "0.6.0", default-features = false, features = ["cargo_bench_support"] }
2626
paste = "1.0.15"
2727

2828
[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]

0 commit comments

Comments
 (0)