avoid copying thread manager state in data race detector
When doing https://github.com/rust-lang/miri/pull/2047 I did not realize that there is some redundant state here that we can now remove from the data race detector.
Also this removes the vector clocks from the data race errors since those don't really help diagnose the problem.
This adds a very simple LRU-like cache which stores the locations of
often-used tags. While the implementation is very simple, the cache hit
rate is incredible at ~99.9% on most programs, and often the element at
position 0 in the cache has a hit rate of 90%. So the sub-optimality of
this cache basicaly vanishes into the noise in a profile.
Additionally, we keep a range which denotes where there might be an item
granting Unique permission in the stack, so that when we invalidate
Uniques we do not need to scan much of the stack, and often scan nothing
at all.
./miri improvements
I have needed to run something with many different seeds often enough that I would like an easier way to do it. ;) So now we have `./miri many-seeds`.
Also I made the script less dependent on the working directory, so calling it from a different directory should work properly now even if that other directory does not have the same rustup override as the one where Miri lives.
Support no-std targets and test it in CI
cc `@jamesmunns`
This is a bit annoying as you need to have `MIRI_NO_STD=1` set at all times, but it works ™️
Once libstd's `restricted_std` feature becomes more usable, we can probably do away with that env var.
I also added a test to CI to make sure it keeps working. This test only builds libcore and runs a single test, so it's pretty fast.
revert --color=always changes
They [cause problems](https://github.com/rust-lang/miri/issues/2277) and they completely break rendering on the playground:
```
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 0.47s
Running `/playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri target/miri/x86_64-unknown-linux-gnu/debug/playground`
[0m[1m[38;5;9merror[E0277][0m[0m[1m: `*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely[0m
[0m [0m[0m[1m[38;5;12m--> [0m[0msrc/main.rs:17:18[0m
[0m [0m[0m[1m[38;5;12m|[0m
[0m[1m[38;5;12m17[0m[0m [0m[0m[1m[38;5;12m|[0m[0m [0m[0m let j1 = spawn(move || {[0m
[0m [0m[0m[1m[38;5;12m| [0m[0m [0m[0m[1m[38;5;12m__________________[0m[0m[1m[38;5;9m^^^^^[0m[0m[1m[38;5;12m_-[0m
[0m [0m[0m[1m[38;5;12m| [0m[0m[1m[38;5;12m|[0m[0m [0m[0m[1m[38;5;9m|[0m
[0m [0m[0m[1m[38;5;12m| [0m[0m[1m[38;5;12m|[0m[0m [0m[0m[1m[38;5;9m`*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely[0m
[0m[1m[38;5;12m18[0m[0m [0m[0m[1m[38;5;12m|[0m[0m [0m[0m[1m[38;5;12m|[0m[0m [0m[0m *(c.0 as *mut usize) = 32;[0m
[0m[1m[38;5;12m19[0m[0m [0m[0m[1m[38;5;12m|[0m[0m [0m[0m[1m[38;5;12m|[0m[0m [0m[0m });[0m
[0m [0m[0m[1m[38;5;12m| [0m[0m[1m[38;5;12m|_________-[0m[0m [0m[0m[1m[38;5;12mwithin this `[closure@src/main.rs:17:24: 19:10]`[0m
[0m [0m[0m[1m[38;5;12m|[0m
```
Sorry `@saethlin,` I think we need to go back to start here and consider another solution.
Fixes https://github.com/rust-lang/miri/issues/2277