Use `Lrc` instead of `Rc` in `MiriCompilerCalls::config()`
The `used_crate_source` query defines its return type as [`Lrc<CrateSource>`](1195bea5a7/compiler/rustc_middle/src/query/mod.rs (L1418)), which would be `Arc` when `parallel-compiler = true`.
I assume this fixesrust-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.
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. :)
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".
Cc https://github.com/rust-lang/miri/issues/1034
Change the code to either `EACCES` (if the op is performed on the
path), or `EBADF` (if the op is performed the fd)
Updated ops: `stat`, `opendir`, `ftruncate64`, and `readlink`
Add a new test for fs ops in isolation.
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".
rustup
This test was removed in rustc in https://github.com/rust-lang/rust/pull/87141.
We added it in https://github.com/rust-lang/miri/pull/1430, and possibly that "interesting case in unsizing" is not covered by tests now -- but I don't remember what that case is.^^ If/when `impl Trait` in bindings comes back, we should copy the new rustc tests to Miri as well.
fmt: set force_multiline_blocks=true
This is an experiment, I am not yet sure if I like it... but it does prevent rustfmt from putting stuff after the `=>` in a `match` (unless the entire arm fits there), which IMO is a big plus. What do others think?
(I also tried setting `match_arm_blocks` back to its default of `true`, but that adds too many braces for my taste.)
Btw, `@calebcartwright` is the interaction of `match_arm_blocks = false` and `force_multiline_blocks = true` as can be seen here expected? I think I like it, but it it is not at all what I expected from the docs which describe `force_multiline_blocks = true` as "Force multiline closure and match arm bodies to be wrapped in a block" -- but here that is not the effect it has, there are no new blocks being added.
sync license files with rustc repo
`@Mark-Simulacrum` pointed out that our license files are slightly different from those in rustc. This syncs them.
The question is... is this a thing we can just do?^^
Use `miri` inside the target directory used by rustc as Miri's target directory
Resolves#1311.
This PR makes Miri use `miri` inside the rustc target directory as its target directory, by letting `cargo-miri` get the rustc target directory by calling `cargo metadata`, append `miri` to it, and pass it with `--target-dir` to Cargo.
Getting the rustc target directory accurately requires calling `cargo metadata` as far as I know, because the `target-dir` can be set in config files in various places that are hard for `cargo-miri` to find.
I also considered https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#custom-named-profiles, but it looks like that requires adding `cargo-features = ["named-profiles"]` to **`Cargo.toml`**, which would be tricky for `cargo-miri`:
```
$ cargo +nightly-2021-06-23 test --config 'profile.miri.inherits="release"' --profile=miri -Z named-profiles -Z unstable-options
error: config profile `miri` is not valid (defined in `--config cli option`)
Caused by:
feature `named-profiles` is required
consider adding `cargo-features = ["named-profiles"]` to the manifest
```