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
Enable permissive provenance by default
This completes the plan laid out in https://github.com/rust-lang/miri/issues/2133:
- We use permissive provenance with wildcard pointers by default.
- We print a warning on int2ptr casts. `-Zmiri-permissive-provenance` suppresses the warning; `-Zmiri-strict-provenance` turns it into a hard error.
- Raw pointer tagging is now always enabled, so we remove the `-Zmiri-tag-raw-pointers` flag and the code for untagged pointers. (Passing the flag still works, for compatibility -- but we just ignore it, with a warning.)
We also fix an intptrcast issue:
- Only live allocations are considered when computing the AllocId from an address.
So, finally, Miri has a good story for ptr2int2ptr roundtrips *and* no weird false negatives when doing raw pointer stuff with Stacked Borrows. :-) 🎉 Thanks a lot to everyone who helped with this, in particular `@carbotaniuman` who convinced me this is even possible.
Fixes https://github.com/rust-lang/miri/issues/2133
Fixes https://github.com/rust-lang/miri/issues/1866
Fixes https://github.com/rust-lang/miri/issues/1993