Skip to content

Commit 8cd834e

Browse files
committed
Auto merge of rust-lang#128030 - GuillaumeGomez:rollup-pp031e7, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#126450 (Promote Mac Catalyst targets to Tier 2, and ship with rustup) - rust-lang#127177 (Distribute rustc_codegen_cranelift for arm64 macOS) - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`) - rust-lang#127977 (Update wasi-sdk in CI to latest release) - rust-lang#127985 (Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake) - rust-lang#128014 (Fix stab display in doc blocks) - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 92c6c03 + ade4026 commit 8cd834e

File tree

22 files changed

+113
-56
lines changed

22 files changed

+113
-56
lines changed

compiler/rustc_codegen_cranelift/Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ For more docs on how to build and test see [build_system/usage.txt](build_system
7070
|FreeBSD|[^no-rustup]||||
7171
|AIX|[^xcoff]|N/A|N/A|[^xcoff]|
7272
|Other unixes|||||
73-
|macOS||[^no-rustup]|N/A|N/A|
73+
|macOS|||N/A|N/A|
7474
|Windows|[^no-rustup]||N/A|N/A|
7575

7676
✅: Fully supported and tested

library/std/src/sys/pal/unix/net.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut};
44
use crate::mem;
55
use crate::net::{Shutdown, SocketAddr};
66
use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
7-
use crate::str;
87
use crate::sys::fd::FileDesc;
98
use crate::sys::pal::unix::IsMinusOne;
109
use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
@@ -47,7 +46,9 @@ pub fn cvt_gai(err: c_int) -> io::Result<()> {
4746

4847
#[cfg(not(target_os = "espidf"))]
4948
let detail = unsafe {
50-
str::from_utf8(CStr::from_ptr(libc::gai_strerror(err)).to_bytes()).unwrap().to_owned()
49+
// We can't always expect a UTF-8 environment. When we don't get that luxury,
50+
// it's better to give a low-quality error message than none at all.
51+
CStr::from_ptr(libc::gai_strerror(err)).to_string_lossy()
5152
};
5253

5354
#[cfg(target_os = "espidf")]

src/bootstrap/src/utils/helpers.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ pub fn target_supports_cranelift_backend(target: TargetSelection) -> bool {
203203
|| target.contains("aarch64")
204204
|| target.contains("s390x")
205205
|| target.contains("riscv64gc")
206-
} else if target.contains("darwin") || target.is_windows() {
206+
} else if target.contains("darwin") {
207+
target.contains("x86_64") || target.contains("aarch64")
208+
} else if target.is_windows() {
207209
target.contains("x86_64")
208210
} else {
209211
false

src/ci/docker/host-x86_64/dist-various-2/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc sun
8585
COPY host-x86_64/dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/
8686
RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh
8787

88-
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz | \
88+
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-23/wasi-sdk-23.0-x86_64-linux.tar.gz | \
8989
tar -xz
90-
ENV WASI_SDK_PATH=/tmp/wasi-sdk-22.0
90+
ENV WASI_SDK_PATH=/tmp/wasi-sdk-23.0-x86_64-linux
9191

9292
COPY scripts/freebsd-toolchain.sh /tmp/
9393
RUN /tmp/freebsd-toolchain.sh i686

src/ci/docker/host-x86_64/test-various/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ WORKDIR /
4040
COPY scripts/sccache.sh /scripts/
4141
RUN sh /scripts/sccache.sh
4242

43-
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz | \
43+
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-23/wasi-sdk-23.0-x86_64-linux.tar.gz | \
4444
tar -xz
45-
ENV WASI_SDK_PATH=/wasi-sdk-22.0
45+
ENV WASI_SDK_PATH=/wasi-sdk-23.0-x86_64-linux
4646

4747
ENV RUST_CONFIGURE_ARGS \
4848
--musl-root-x86_64=/usr/local/x86_64-linux-musl \

src/ci/github-actions/jobs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ auto:
285285

286286
- image: dist-apple-various
287287
env:
288-
SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
288+
SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-ios-macabi,x86_64-apple-ios-macabi
289289
RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc
290290
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
291291
MACOSX_DEPLOYMENT_TARGET: 10.12
@@ -326,6 +326,7 @@ auto:
326326
NO_DEBUG_ASSERTIONS: 1
327327
NO_OVERFLOW_CHECKS: 1
328328
DIST_REQUIRE_ALL_TOOLS: 1
329+
CODEGEN_BACKENDS: llvm,cranelift
329330
<<: *job-macos-m1
330331

331332
# This target only needs to support 11.0 and up as nothing else supports the hardware

src/doc/rustc/src/platform-support.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ so Rustup may install the documentation for a similar tier 1 target instead.
135135
target | std | notes
136136
-------|:---:|-------
137137
[`aarch64-apple-ios`](platform-support/apple-ios.md) | ✓ | ARM64 iOS
138+
[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on ARM64
138139
[`aarch64-apple-ios-sim`](platform-support/apple-ios.md) | ✓ | Apple iOS Simulator on ARM64
139140
`aarch64-fuchsia` | ✓ | Alias for `aarch64-unknown-fuchsia`
140141
[`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia
@@ -195,6 +196,7 @@ target | std | notes
195196
[`wasm32-wasip1`](platform-support/wasm32-wasip1.md) | ✓ | WebAssembly with WASI
196197
[`wasm32-wasip1-threads`](platform-support/wasm32-wasip1-threads.md) | ✓ | WebAssembly with WASI Preview 1 and threads
197198
[`x86_64-apple-ios`](platform-support/apple-ios.md) | ✓ | 64-bit x86 iOS
199+
[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64
198200
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
199201
`x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia`
200202
[`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
@@ -244,7 +246,6 @@ target | std | host | notes
244246
-------|:---:|:----:|-------
245247
[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS
246248
[`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md) | ✓ | ✓ | ARM64e Apple Darwin
247-
[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | | Apple Catalyst on ARM64
248249
[`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS
249250
[`aarch64-apple-tvos-sim`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS Simulator
250251
[`aarch64-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS
@@ -370,7 +371,6 @@ target | std | host | notes
370371
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode Armv7-A Linux with NEON, musl 1.2.3
371372
[`wasm32-wasip2`](platform-support/wasm32-wasip2.md) | ✓ | | WebAssembly
372373
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
373-
[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | | Apple Catalyst on x86_64
374374
[`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | x86 64-bit tvOS
375375
[`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator
376376
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS |

src/doc/rustc/src/platform-support/apple-ios-macabi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Apple Mac Catalyst targets.
44

5-
**Tier: 3**
5+
**Tier: 2 (without Host Tools)**
66

77
- `aarch64-apple-ios-macabi`: Mac Catalyst on ARM64.
88
- `x86_64-apple-ios-macabi`: Mac Catalyst on 64-bit x86.

src/librustdoc/html/static/css/rustdoc.css

+5
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ pre, .rustdoc.src .example-wrap {
831831
background: var(--table-alt-row-background-color);
832832
}
833833

834+
.docblock .stab, .docblock-short .stab {
835+
display: inline-block;
836+
}
837+
834838
/* "where ..." clauses with block display are also smaller */
835839
div.where {
836840
white-space: pre-wrap;
@@ -953,6 +957,7 @@ table,
953957
display: table;
954958
padding: 0;
955959
margin: 0;
960+
width: 100%;
956961
}
957962
.item-table > li {
958963
display: table-row;

src/tools/build-manifest/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static TARGETS: &[&str] = &[
5454
"arm64e-apple-darwin",
5555
"aarch64-apple-ios",
5656
"arm64e-apple-ios",
57+
"aarch64-apple-ios-macabi",
5758
"aarch64-apple-ios-sim",
5859
"aarch64-unknown-fuchsia",
5960
"aarch64-linux-android",
@@ -160,6 +161,7 @@ static TARGETS: &[&str] = &[
160161
"wasm32-wasip2",
161162
"x86_64-apple-darwin",
162163
"x86_64-apple-ios",
164+
"x86_64-apple-ios-macabi",
163165
"x86_64-fortanix-unknown-sgx",
164166
"x86_64-unknown-fuchsia",
165167
"x86_64-linux-android",

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ run-make/branch-protection-check-IBT/Makefile
22
run-make/c-dynamic-dylib/Makefile
33
run-make/c-dynamic-rlib/Makefile
44
run-make/c-unwind-abi-catch-lib-panic/Makefile
5-
run-make/c-unwind-abi-catch-panic/Makefile
65
run-make/cat-and-grep-sanity-check/Makefile
76
run-make/cdylib-dylib-linkage/Makefile
8-
run-make/compiler-lookup-paths-2/Makefile
97
run-make/compiler-rt-works-on-mingw/Makefile
108
run-make/cross-lang-lto-clang/Makefile
119
run-make/cross-lang-lto-pgo-smoketest/Makefile
@@ -90,7 +88,6 @@ run-make/staticlib-dylib-linkage/Makefile
9088
run-make/symbol-mangling-hashed/Makefile
9189
run-make/symbol-visibility/Makefile
9290
run-make/sysroot-crates-are-unstable/Makefile
93-
run-make/test-benches/Makefile
9491
run-make/thumb-none-cortex-m/Makefile
9592
run-make/thumb-none-qemu/Makefile
9693
run-make/translation/Makefile

tests/run-make/c-unwind-abi-catch-panic/Makefile

-10
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// A test for calling `C-unwind` functions across foreign function boundaries (FFI).
2+
// This test triggers a panic when calling a foreign function that calls *back* into Rust.
3+
// This catches a panic across an FFI boundary and downcasts it into an integer.
4+
// The Rust code that panics is in the same directory, unlike `c-unwind-abi-catch-lib-panic`.
5+
// See https://github.com/rust-lang/rust/pull/76570
6+
7+
//@ ignore-cross-compile
8+
// Reason: the compiled binary is executed
9+
//@ needs-unwind
10+
// Reason: this test exercises panic unwinding
11+
12+
use run_make_support::{build_native_static_lib, run, rustc};
13+
14+
fn main() {
15+
build_native_static_lib("add");
16+
rustc().input("main.rs").run();
17+
run("main");
18+
}

tests/run-make/compiler-lookup-paths-2/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This test checks that extern crate declarations in Cargo without a corresponding declaration
2+
// in the manifest of a dependency are NOT allowed. The last rustc call does it anyways, which
3+
// should result in a compilation failure.
4+
// See https://github.com/rust-lang/rust/pull/21113
5+
6+
use run_make_support::{path, rfs, rust_lib_name, rustc};
7+
8+
fn main() {
9+
rfs::create_dir("a");
10+
rfs::create_dir("b");
11+
rustc().input("a.rs").run();
12+
rfs::rename(rust_lib_name("a"), path("a").join(rust_lib_name("a")));
13+
rustc().input("b.rs").library_search_path("a").run();
14+
rfs::rename(rust_lib_name("b"), path("b").join(rust_lib_name("b")));
15+
rustc()
16+
.input("c.rs")
17+
.library_search_path("crate=b")
18+
.library_search_path("dependency=a")
19+
.run_fail();
20+
}

tests/run-make/test-benches/Makefile

-12
This file was deleted.

tests/run-make/test-benches/rmake.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// #[bench] is a Rust feature to run benchmarks on performance-critical
2+
// code, which previously experienced a runtime panic bug in #103794.
3+
// In order to ensure future breakages of this feature are detected, this
4+
// smoke test was created, using the benchmarking feature with various
5+
// runtime flags.
6+
// See https://github.com/rust-lang/rust/issues/103794
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
//@ needs-unwind
11+
// Reason: #[bench] and -Zpanic-abort-tests can't be combined
12+
13+
use run_make_support::{run, run_with_args, rustc};
14+
15+
fn main() {
16+
// Smoke-test that #[bench] isn't entirely broken.
17+
rustc().arg("--test").input("smokebench.rs").opt().run();
18+
run_with_args("smokebench", &["--bench"]);
19+
run_with_args("smokebench", &["--bench", "noiter"]);
20+
run_with_args("smokebench", &["--bench", "yesiter"]);
21+
run("smokebench");
22+
}

tests/run-make/wasm-panic-small/rmake.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ fn main() {
1313
fn test(cfg: &str) {
1414
eprintln!("running cfg {cfg:?}");
1515

16-
rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").opt().cfg(cfg).run();
16+
rustc()
17+
.input("foo.rs")
18+
.target("wasm32-wasip1")
19+
.arg("-Clto")
20+
.arg("-Cstrip=debuginfo")
21+
.opt()
22+
.cfg(cfg)
23+
.run();
1724

1825
let bytes = rfs::read("foo.wasm");
1926
println!("{}", bytes.len());

tests/run-make/wasm-stringify-ints-small/rmake.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
use run_make_support::{rfs, rustc};
55

66
fn main() {
7-
rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
7+
rustc()
8+
.input("foo.rs")
9+
.target("wasm32-wasip1")
10+
.arg("-Clto")
11+
.arg("-Cstrip=debuginfo")
12+
.opt()
13+
.run();
814

915
let bytes = rfs::read("foo.wasm");
1016
println!("{}", bytes.len());

tests/rustdoc-gui/source-code-page-code-scroll.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
33
set-window-size: (800, 1000)
44
// "scrollWidth" should be superior than "clientWidth".
5-
assert-property: ("body", {"scrollWidth": 1047, "clientWidth": 800})
5+
assert-property: ("body", {"scrollWidth": 1114, "clientWidth": 800})
66

77
// Both properties should be equal (ie, no scroll on the code block).
8-
assert-property: (".example-wrap .rust", {"scrollWidth": 933, "clientWidth": 933})
8+
assert-property: (".example-wrap .rust", {"scrollWidth": 1000, "clientWidth": 1000})

tests/rustdoc-gui/src/test_docs/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated
2020
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
2121
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
2222
23-
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
24-
</span>.
25-
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
26-
</span>.
23+
Finally, you can use `quz` only on <span class="stab portability" data-span="1"><code>Unix or x86-64
24+
</code></span>.
25+
Finally, you can use `quz` only on <span class="stab portability" data-span="2"><code>Unix or x86-64
26+
</code></span>.
2727
*/
2828

2929
use std::convert::AsRef;

tests/rustdoc-gui/stab-in-doc.goml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This test ensure that `stab` elements if used in doc blocks are not breaking the text layout.
2+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
3+
// We make the window wide enough for the two stabs who are looking into to be on the same line.
4+
set-window-size: (1100, 600)
5+
compare-elements-position: (
6+
".top-doc .docblock span[data-span='1']",
7+
".top-doc .docblock span[data-span='2']",
8+
["y"],
9+
)

0 commit comments

Comments
 (0)