Skip to content

Commit 637a7cf

Browse files
committed
Auto merge of #18183 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
2 parents 280275c + 781d3c7 commit 637a7cf

File tree

888 files changed

+8078
-5659
lines changed

Some content is hidden

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

888 files changed

+8078
-5659
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
schedule:
1313
- cron: '44 4 * * *' # At 4:44 UTC every day.
1414

15+
permissions:
16+
contents: write
17+
1518
defaults:
1619
run:
1720
shell: bash

.github/workflows/sysroots.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Build the sysroots
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- name: Build the sysroots
1818
run: |
1919
cargo install -f rustup-toolchain-install-master

Cargo.lock

+28-53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ features = ['unprefixed_malloc_on_supported_platforms']
3737

3838
[target.'cfg(unix)'.dependencies]
3939
libc = "0.2"
40-
41-
[target.'cfg(target_os = "linux")'.dependencies]
4240
libffi = "3.2.0"
4341
libloading = "0.8"
4442

@@ -51,7 +49,7 @@ windows-sys = { version = "0.52", features = [
5149

5250
[dev-dependencies]
5351
colored = "2"
54-
ui_test = "0.21.1"
52+
ui_test = "0.26.5"
5553
rustc_version = "0.4"
5654
regex = "1.5.5"
5755
tempfile = "3"

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Here is an example job for GitHub Actions:
187187
name: "Miri"
188188
runs-on: ubuntu-latest
189189
steps:
190-
- uses: actions/checkout@v3
190+
- uses: actions/checkout@v4
191191
- name: Install Miri
192192
run: |
193193
rustup toolchain install nightly --component miri
@@ -216,9 +216,9 @@ degree documented below):
216216
- For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we
217217
make no promises and we don't run tests for such targets.
218218
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems.
219+
- `solaris` / `illumos`: maintained by @devnexen. Supports `std::{env, thread, sync}`, but not `std::fs`.
219220
- `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`.
220221
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
221-
- `solaris` / `illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works.
222222
- `wasm`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works.
223223
- For targets on other operating systems, Miri might fail before even reaching the `main` function.
224224

@@ -383,7 +383,7 @@ to Miri failing to detect cases of undefined behavior in a program.
383383
file descriptors will be mixed up.
384384
This is **work in progress**; currently, only integer arguments and return values are
385385
supported (and no, pointer/integer casts to work around this limitation will not work;
386-
they will fail horribly). It also only works on Linux hosts for now.
386+
they will fail horribly). It also only works on Unix hosts for now.
387387
* `-Zmiri-measureme=<name>` enables `measureme` profiling for the interpreted program.
388388
This can be used to find which parts of your program are executing slowly under Miri.
389389
The profile is written out to a file inside a directory called `<name>`, and can be processed

bench-cargo-miri/slice-chunked/Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "slice-chunked"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//! This is a small example using slice::chunks, which creates a very large Tree Borrows tree.
2+
//! Thanks to ##3837, the GC now compacts the tree, so this test can be run in a reasonable time again.
3+
//! The actual code is adapted from tiny_skia, see https://github.com/RazrFalcon/tiny-skia/blob/master/src/pixmap.rs#L121
4+
//! To make this benchmark demonstrate the effectiveness, run with MIRIFLAGS="-Zmiri-tree-borrows -Zmiri-provenance-gc=100"
5+
6+
const N: usize = 1000;
7+
8+
fn input_vec() -> Vec<u8> {
9+
vec![0; N]
10+
}
11+
12+
fn main() {
13+
let data_len = 2 * N;
14+
let mut rgba_data = Vec::with_capacity(data_len);
15+
let img_data = input_vec();
16+
for slice in img_data.chunks(2) {
17+
let gray = slice[0];
18+
let alpha = slice[1];
19+
rgba_data.push(gray);
20+
rgba_data.push(gray);
21+
rgba_data.push(gray);
22+
rgba_data.push(alpha);
23+
}
24+
25+
assert_eq!(rgba_data.len(), data_len);
26+
}

ci/ci.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ time ./miri install
2626
# We enable all features to make sure the Stacked Borrows consistency check runs.
2727
echo "Building debug version of Miri"
2828
export CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS --all-features"
29-
time ./miri build --all-targets # the build that all the `./miri test` below will use
29+
time ./miri build # the build that all the `./miri test` below will use
3030

3131
endgroup
3232

@@ -66,7 +66,7 @@ function run_tests {
6666
time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $TARGET_FLAG tests/{pass,panic}
6767
fi
6868
if [ -n "${MANY_SEEDS-}" ]; then
69-
# Also run some many-seeds tests.
69+
# Also run some many-seeds tests. (Also tests `./miri run`.)
7070
time for FILE in tests/many-seeds/*.rs; do
7171
./miri run "--many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE"
7272
done
@@ -75,6 +75,8 @@ function run_tests {
7575
# Check that the benchmarks build and run, but only once.
7676
time HYPERFINE="hyperfine -w0 -r1" ./miri bench $TARGET_FLAG
7777
fi
78+
# Smoke-test `./miri run --dep`.
79+
./miri run $TARGET_FLAG --dep tests/pass-dep/getrandom.rs
7880

7981
## test-cargo-miri
8082
# On Windows, there is always "python", not "python3" or "python2".
@@ -148,11 +150,11 @@ case $HOST_TARGET in
148150
# Partially supported targets (tier 2)
149151
BASIC="empty_main integer vec string btreemap hello hashmap heap_alloc align" # ensures we have the basics: stdout/stderr, system allocator, randomness (for HashMap initialization)
150152
UNIX="panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
151-
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs
152-
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs
153-
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time tls
154-
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time tls
155-
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX
153+
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs
154+
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs
155+
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls
156+
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls
157+
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX pthread --skip threadname --skip pthread_cond_timedwait
156158
TEST_TARGET=wasm32-wasip2 run_tests_minimal empty_main wasm heap_alloc libc-mem
157159
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal empty_main wasm
158160
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std

0 commit comments

Comments
 (0)