move vector_clock and sync into concurrency & make vector_clock private
Closes https://github.com/rust-lang/miri/issues/2199
The thread.rs didn't have to be moved to build.
If it makes more sense to move the thread.rs as well, please let me know. I can move it as well.
add ./miri cargo for RA to invoke
RA expects a check command to check *individual workspaces*, whereas `./miri` is designed to check/build/test all parts of Miri. So add a new `./miri cargo` that performs just a single cargo invocation, but with the right env vars so that the build cache can be shared with `./miri check`.
Improve information sharing across SB diagnostics
Previous Stacked Borrows diagnostics were missing a lot of information about the state of the interpreter, and it was difficult to add additional state because it was threaded through all the intervening function signatures.
This change factors a lot of the arguments which used to be passed individually to many stacked borrows functions into a single `DiagnosticCx`, which is built in `Stacks::for_each`, and since it wraps a handle to `AllocHistory`, we can now handle more nuanced things like heterogeneous borrow of `!Freeze` types.
Previous Stacked Borrows diagnostics were missing a lot of information
about the state of the interpreter, and it was difficult to add
additional state because it was threaded through all the intervening
function signatures.
This change factors a lot of the arguments which used to be passed
individually to many stacked borrows functions into a single
`DiagnosticCx`, which is built in `Stacks::for_each`, and since it
wraps a handle to `AllocHistory`, we can now handle more nuanced
things like heterogeneous borrow of `!Freeze` types.
add very basic Android support
This is just enough to print to stdout. I won't push this any further, but having these basics should hopefully make it easier for others to do so.
Also slightly improve threading support on FreeBSD while we are at it.
Partially based on https://github.com/rust-lang/miri/pull/2011.
Fixes https://github.com/rust-lang/miri/issues/2010.
Breaking posix_memalign precondition is not UB
The `size==0` test here might be overtesting, but I figured might as well test it and leave a comment saying it is fine to remove it if the implementation changes.
Fixes#2099
add test that we do not merge neighboring SRW
Turns out that interior_mut2 also already tests this, but that also involves `UnsafeCell` so the new test still seems more clear. Basically the new test is the same as the old except that it uses raw pointers rather than `&UnsafeCell`. (When the old test was written, raw pointers were still untagged, so no such test would have been possible.)
I verified that both of these fail when we remove mutable references rather than disabling them.
Here is the patch I used for that:
<details>
```diff
diff --git a/Cargo.toml b/Cargo.toml
index 208b3a76..f9d1b0ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
`@@` -53,7 +53,7 `@@` name = "compiletest"
harness = false
[features]
-default = ["stack-cache"]
+default = []
stack-cache = []
# Be aware that this file is inside a workspace when used via the
diff --git a/src/lib.rs b/src/lib.rs
index ba337f28..2a3066f4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
`@@` -9,6 +9,7 `@@`
#![feature(is_some_with)]
#![feature(nonzero_ops)]
#![feature(local_key_cell_methods)]
+#![feature(drain_filter)]
// Configure clippy and other lints
#![allow(
clippy::collapsible_else_if,
diff --git a/src/stacked_borrows/stack.rs b/src/stacked_borrows/stack.rs
index 4a9a13d3..37246df7 100644
--- a/src/stacked_borrows/stack.rs
+++ b/src/stacked_borrows/stack.rs
`@@` -351,6 +351,9 `@@` impl<'tcx> Stack {
#[cfg(all(feature = "stack-cache", debug_assertions))]
self.verify_cache_consistency();
+ // HACK -- now just delete all disabled things.
+ self.borrows.drain_filter(|b| matches!(b.perm(), Permission::Disabled));
+
Ok(())
}
```
</details>
r? `@saethlin`