Skip to content

Commit 9ea4a45

Browse files
committed
Auto merge of #146156 - RalfJung:miri, r=RalfJung
miri subtree update Subtree update of `miri` to rust-lang/miri@883dbf0. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents fd75a9c + 18683c2 commit 9ea4a45

Some content is hidden

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

63 files changed

+1657
-632
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,9 +3204,9 @@ dependencies = [
32043204

32053205
[[package]]
32063206
name = "rustc-build-sysroot"
3207-
version = "0.5.9"
3207+
version = "0.5.11"
32083208
source = "registry+https://github.com/rust-lang/crates.io-index"
3209-
checksum = "fdb13874a0e55baf4ac3d49d38206aecb31a55b75d6c4d04fd850b53942c8cc8"
3209+
checksum = "3b881c015c729b43105bbd3702a9bdecee28fafaa21126d1d62e454ec011a4b7"
32103210
dependencies = [
32113211
"anyhow",
32123212
"rustc_version",

src/tools/miri/.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ jobs:
4141
multiarch: s390x
4242
gcc_cross: s390x-linux-gnu
4343
qemu: true
44+
- host_target: powerpc64le-unknown-linux-gnu
45+
os: ubuntu-latest
46+
multiarch: ppc64el
47+
gcc_cross: powerpc64le-linux-gnu
48+
qemu: true
4449
- host_target: aarch64-apple-darwin
4550
os: macos-latest
4651
- host_target: i686-pc-windows-msvc

src/tools/miri/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ when installing the Miri toolchain. Alternatively, set the `RUSTUP_TOOLCHAIN` en
255255

256256
[`etc/rust_analyzer_helix.toml`]: https://github.com/rust-lang/miri/blob/master/etc/rust_analyzer_helix.toml
257257

258+
### Zed
259+
260+
Copy [`etc/rust_analyzer_zed.json`] to `.zed/settings.json` in the project root directory.
261+
262+
[`etc/rust_analyzer_zed.json`]: https://github.com/rust-lang/miri/blob/master/etc/rust_analyzer_zed.json
263+
258264
### Advanced configuration
259265

260266
If you are building Miri with a locally built rustc, set

src/tools/miri/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,9 +1569,9 @@ dependencies = [
15691569

15701570
[[package]]
15711571
name = "tracing-subscriber"
1572-
version = "0.3.19"
1572+
version = "0.3.20"
15731573
source = "registry+https://github.com/rust-lang/crates.io-index"
1574-
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
1574+
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
15751575
dependencies = [
15761576
"sharded-slab",
15771577
"thread_local",

src/tools/miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
3939
[target.'cfg(unix)'.dependencies]
4040
libc = "0.2"
4141
# native-lib dependencies
42-
libffi = { version = "4.0.0", optional = true }
42+
libffi = { version = "4.1.1", optional = true }
4343
libloading = { version = "0.8", optional = true }
4444
serde = { version = "1.0.219", features = ["derive"], optional = true }
4545

src/tools/miri/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,14 @@ environment variable. We first document the most relevant and most commonly used
319319
Can be used without a value; in that case the range defaults to `0..64`.
320320
* `-Zmiri-many-seeds-keep-going` tells Miri to really try all the seeds in the given range, even if
321321
a failing seed has already been found. This is useful to determine which fraction of seeds fails.
322+
* `-Zmiri-max-extra-rounding-error` tells Miri to always apply the maximum error to float operations
323+
that do not have a guaranteed precision. The sign of the error is still non-deterministic.
322324
* `-Zmiri-no-extra-rounding-error` stops Miri from adding extra rounding errors to float operations
323325
that do not have a guaranteed precision.
326+
* `-Zmiri-no-short-fd-operations` stops Miri from artificially forcing `read`/`write` operations
327+
to only process a part of their buffer. Note that whenever Miri uses host operations to
328+
implement `read`/`write` (e.g. for file-backed file descriptors), the host system can still
329+
introduce short reads/writes.
324330
* `-Zmiri-num-cpus` states the number of available CPUs to be reported by miri. By default, the
325331
number of available CPUs is `1`. Note that this flag does not affect how miri handles threads in
326332
any way.

src/tools/miri/cargo-miri/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,9 @@ dependencies = [
429429

430430
[[package]]
431431
name = "rustc-build-sysroot"
432-
version = "0.5.9"
432+
version = "0.5.10"
433433
source = "registry+https://github.com/rust-lang/crates.io-index"
434-
checksum = "fdb13874a0e55baf4ac3d49d38206aecb31a55b75d6c4d04fd850b53942c8cc8"
434+
checksum = "dd41ead66a69880951b2f7df3139db401d44451b4da123344d27eaa791b89c95"
435435
dependencies = [
436436
"anyhow",
437437
"rustc_version",

src/tools/miri/cargo-miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ directories = "6"
1818
rustc_version = "0.4"
1919
serde_json = "1.0.40"
2020
cargo_metadata = "0.21"
21-
rustc-build-sysroot = "0.5.8"
21+
rustc-build-sysroot = "0.5.10"
2222

2323
# Enable some feature flags that dev-dependencies need but dependencies
2424
# do not. This makes `./miri install` after `./miri build` faster.

src/tools/miri/cargo-miri/src/phases.rs

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ fn forward_patched_extern_arg(args: &mut impl Iterator<Item = String>, cmd: &mut
6565
}
6666

6767
pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
68-
// Check for version and help flags even when invoked as `cargo-miri`.
69-
if has_arg_flag("--help") || has_arg_flag("-h") {
70-
show_help();
71-
return;
72-
}
73-
if has_arg_flag("--version") || has_arg_flag("-V") {
74-
show_version();
75-
return;
76-
}
77-
7868
// Require a subcommand before any flags.
7969
// We cannot know which of those flags take arguments and which do not,
8070
// so we cannot detect subcommands later.
@@ -85,11 +75,36 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
8575
"setup" => MiriCommand::Setup,
8676
"test" | "t" | "run" | "r" | "nextest" => MiriCommand::Forward(subcommand),
8777
"clean" => MiriCommand::Clean,
88-
_ =>
78+
_ => {
79+
// Check for version and help flags.
80+
if has_arg_flag("--help") || has_arg_flag("-h") {
81+
show_help();
82+
return;
83+
}
84+
if has_arg_flag("--version") || has_arg_flag("-V") {
85+
show_version();
86+
return;
87+
}
8988
show_error!(
9089
"`cargo miri` supports the following subcommands: `run`, `test`, `nextest`, `clean`, and `setup`."
91-
),
90+
)
91+
}
9292
};
93+
if has_arg_flag("--help") || has_arg_flag("-h") {
94+
match subcommand {
95+
MiriCommand::Forward(verb) => {
96+
println!("`cargo miri {verb}` supports the same flags as `cargo {verb}`:\n");
97+
let mut cmd = cargo();
98+
cmd.arg(verb);
99+
cmd.arg("--help");
100+
exec(cmd);
101+
}
102+
_ => {
103+
show_help();
104+
return;
105+
}
106+
}
107+
}
93108
let verbose = num_arg_flag("-v") + num_arg_flag("--verbose");
94109
let quiet = has_arg_flag("-q") || has_arg_flag("--quiet");
95110

76.1 KB
Loading

0 commit comments

Comments
 (0)