Auto merge of #1885 - DrMeepster:global_allocator, r=RalfJung
add support for `#[global_allocator]`
This PR adds support for custom global allocators. Unfortunately, the code given in #1207 still causes errors when used with box. I believe this is because Box is special-cased in miri and stacked borrows.
Auto merge of #1891 - ChrisDenton:win-args, r=RalfJung
Correct Windows argument handling
Previously the command line string would have been incorrectly constructed if argv[0] contained a doublequote (`"`) or ended in a trailing backslash (`\`). This is a very rare edge case because, by convention, argv[0] is the path to the application and Windows file names cannot contain doublequotes.
Chris Denton [Sat, 18 Sep 2021 15:57:31 +0000 (16:57 +0100)]
Correct Windows argument handling
Previously the command line string would have been incorrectly constructed if argv[0] contained a doublequote (`"`) or ended in a trailing backslash (`\`). This is a very rare edge case because, by convention, argv[0] is the path to the application and Windows file names cannot contain doublequotes.
Auto merge of #1890 - Smittyvb:cargo-miri-short-alias, r=RalfJung
One character aliases for cargo-miri run/test
The main `cargo` command supports `cargo r` as an alias for `cargo run`, and `cargo t` as an alias for `cargo test`. This adds support to them in `cargo-miri` for consistency.
The main `cargo` command supports `cargo r` as an alias for
`cargo run`, and `cargo t` as an alias for `cargo test`. This adds
support to them in cargo-miri for consistency.
There are some new dead code warnings in the tests: https://github.com/rust-lang/miri/runs/3573853719?check_suite_focus=true#step:8:290
I guess this is related to https://github.com/rust-lang/rust/pull/85200, and add `#[allow(dead_code)]` to suppress them in this PR (I assume this is fine because https://github.com/rust-lang/rust/pull/85200 also suppresses warnings in rustc's tests).
Hello. I am trying to [update some Clippy dependencies](https://github.com/rust-lang/rust/pull/88517) in the rust repo. To help keep the overall number of dependencies down, I was asked to submit a PR here to update `compiletest_rs` to from `0.6.0` to `0.7.0`. I ran CI on my fork and the update didn't seem to cause any problems.
bors [Mon, 30 Aug 2021 15:33:59 +0000 (15:33 +0000)]
Auto merge of #1879 - oli-obk:gitpod, r=RalfJung
Try out gitpod
At https://gitpod.io/#https://github.com/rust-lang/miri one can edit miri in the browser and run it and everything.
I'm experimenting with this here as a low-impact version of trying it out on the whole rustc repo. This .gitpod file should cause the user to land in a shell that can run ./miri test immediately without any additional prep
bors [Tue, 24 Aug 2021 12:39:59 +0000 (12:39 +0000)]
Auto merge of #1877 - hyd-dev:rustup, r=RalfJung
Add `#[allow(unreachable_code)]` to `drop(x)` in `tests/run-pass/generator.rs`
The test [starts to trigger this warning](https://github.com/rust-lang/miri/runs/3408355084?check_suite_focus=true#step:8:264) (I guess it's caused by rust-lang/rust#85556). The warning seems correct, but the unreachable code in that test also seems reasonable.
bors [Mon, 23 Aug 2021 10:55:48 +0000 (10:55 +0000)]
Auto merge of #1875 - niluxv:volatile_set_memory_intrinsic, r=RalfJung
Add support for the `volatile_set_memory` intrinsic
Add support for the unstable `volatile_set_memory` intrinsic
(Runtime behaviour and soundness requirements for `volatile_set_memory` are identical to those of `write_bytes`, so supporting this intrinsic is trivial.)
bors [Sun, 15 Aug 2021 11:41:00 +0000 (11:41 +0000)]
Auto merge of #1871 - hyd-dev:no-mangle-method, r=RalfJung
Update tests for `#[no_mangle]` on associated functions
https://github.com/rust-lang/rust/pull/86492 has landed:
- The code in https://github.com/rust-lang/miri/issues/1837 starts to work (even without `AssocFn::foo();` at line 12) in Miri.
- `pub` is not necessary for `#[no_mangle]` associated functions in `test-cargo-miri/exported-symbol-dep/src/lib.rs` anymore.
bors [Wed, 4 Aug 2021 09:25:18 +0000 (09:25 +0000)]
Auto merge of #1864 - hyd-dev:rustup, r=RalfJung
Update cargo-miri test
The doctest output was [changed](https://github.com/rust-lang/miri/runs/3238758260?check_suite_focus=true#step:8:1263) (probably by https://github.com/rust-lang/cargo/pull/9730). Update `test-cargo-miri/test.default.stdout.ref` to match the new output.
Auto merge of #1863 - hyd-dev:parallel-compiler, r=RalfJung
Use `Lrc` instead of `Rc` in `MiriCompilerCalls::config()`
The `used_crate_source` query defines its return type as [`Lrc<CrateSource>`](https://github.com/rust-lang/rust/blob/1195bea5a7b73e079fa14b37ac7e375fc77d368a/compiler/rustc_middle/src/query/mod.rs#L1418), which would be `Arc` when `parallel-compiler = true`.
I assume this fixes rust-lang/rust#87623. I didn't test that locally -- I'm not interested in `parallel-compiler = true` enough to be willing to recompile rustc with that configuration to test it, but I'm submitting this in case it might be useful for `parallel-compiler = true` users.
Auto merge of #1858 - RalfJung:thread-leaks, r=oli-obk
also ignore 'thread leaks' with -Zmiri-ignore-leaks
This is a step towards https://github.com/rust-lang/miri/issues/1371. The remaining hard part would be supporting checking for memory leaks when there are threads still running. For now we elegantly avoid this problem by using the same flag to control both of these checks. :)
Auto merge of #1838 - atsmtat:fs-isolation, r=RalfJung
Fix use of deprecated `check_no_isolation` in posix fs shims
Update posix fs shims to use new API `reject_in_isolation`, which
allows rejection with error code instead of always forcing abort.
Error code chosen for each op is the most appropriate one from the
list in corresponding syscall's manual.
Updated helper APIs to not use quotes (\`) around input name while
preparing the message. This allows callers to pass multi-word string
like -- "\`read\` from stdin".