Nanosleep
This PR adds a shim for `libc::nanosleep`, (available under -Zmiri-disable-isolation only) which backs `thread::sleep` on Linux and macOS. I started off by extracting the `timespec` parsing from the `pthread_cond_timedwait` shim into a helper method, and adding checks for invalid values. The second commit adds the new shim and a small test. The shim blocks the current thread, and registers a timeout callback to unblock the thread again, using the same method as `pthread_cond_timedwait` does.
Change `ty.kind` -> `ty.kind()`
This fixes build failure due to rust-lang/rust#75077, cc rust-lang/rust#76337.
(This is my first PR here, please tell me if anything's wrong)
Move panic payload state from Machine to Thread
This PR moves the panic payload storage from the `Machine` state to per-thread state. Prior to this change, if one thread panicked while another was still unwinding, Miri would fail with `thread 'rustc' panicked at 'the panic runtime should avoid double-panics', src/shims/panic.rs:51:9`. I ran into this issue while prototyping a round-robin scheduler, but it's also reachable with the current scheduler and contrived programs that use blocking API calls to cause thread switching during unwinding. I wrote a test case along those lines for this change.
Support --test/--bin/--lib in cargo-miri
This PR addresses a FIXME in cargo-miri, and filters the targets to be checked when any of the `--bin`, '--test`, or `--lib` flags are passed.
Remove byteorder dependency
miri hasn't actually depended on byteorder directly for a while.
Let's remove this dependency so Rust also depends less on it.
forgot to add alignment test loop in one test
As expected, checking the physical integer address made alignment tests fragile, and I forgot to add the retry loop for this one.