Improvements to the README item on `-Zmiri-track-raw-pointers`.
[Rendered](https://github.com/jrvanwhy/miri/tree/track-raw-pointers-doc)
Minor change: I changed the quotes around `<untagged>` into backticks, so they render correctly in markdown.
~~Significant change: I documented that `-Zmiri-track-raw-pointers` is a strictly more restrictive model that "normal" Stacked Borrows. **I am not confident this change is correct, please verify it.** If this change is not correct, let me know, and I'll update this PR to document that :-)~~
EDIT: I was wrong, `-Zmiri-track-raw-pointers` may not be strictly more restrictive. I added the following sentence to prevent others from making the same assumption that I did:
> Note that it is not currently guaranteed that code that works with `-Zmiri-track-raw-pointers` also works without `-Zmiri-track-raw-pointers`.
1. The double quotes around <untagged> are changed to backspaces, so <untagged>
will render correctly in markdown.
2. Clarify that -Zmiri-track-raw-pointers will never accept code that Miri
would not have accepted without -Zmiri-track-raw-pointers.
Improve error message of calling unsupported non-"C"/"system"-ABI foreign function
Miri currently reports the following `foo()` call has ABI-mismatch UB:
```rust
#[cfg(unix)]
extern "Rust" { // or any non-"C" ABI
fn foo();
}
#[cfg(windows)]
extern "C" { // or any non-"system" ABI
fn foo();
}
fn main() {
unsafe {
foo();
}
}
```
[Output when targeting Linux](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=72afc3bd4d9fdab962422cfc2c5a2166) (and maybe also macOS):
```
error: Undefined Behavior: calling a function with ABI C using caller ABI Rust
--> src/main.rs:13:9
|
13 | foo();
| ^^^^^ calling a function with ABI C using caller ABI Rust
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavio
```
Output when targeting Windows:
```
error: Undefined Behavior: calling a function with ABI system using caller ABI C
--> <anon>:13:9
|
13 | foo();
| ^^^^^ calling a function with ABI system using caller ABI C
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
```
However, to my knowledge, that's not UB -- it's just unsupported by Miri (and Miri can't assume the function has `"C"` or `"system"` ABI since Miri doesn't know about it). I believe that is because of the overzealous `check_abi()` call before the long `match` in `src/shims/{posix,windows}/foreign_items.rs`. The ABI is checked to match the system one (`"system"` on Windows, `"C"` otherwise) no matter the callee is recognized as a shim or an unsupported foreign function.
Therefore, this PR removes the `check_abi()` call before the `match` and inserts a `check_abi()` call to each non-wildcard match.
Remove unwrap_none/expect_none, take 2.
This is https://github.com/rust-lang/miri/pull/1734, but now with a better alternative.
This also upgrades rustc to the latest version, to be able to use the better alternative (`try_insert`).
Support breakpoint intrinsic
The `breakpoint` intrinsic raises a `SIGTRAP` signal. If a debugger is attached to a normal program, then `SIGTRAP` can be used to trigger breakpoints in debuggers like `gdb`. If there is no debugger, then the program exits with a message like `Trace/breakpoint trap (core dumped)`. This adds support for the intrinsic in Miri. While actually passing through the `SIGTRAP` doesn't make sense in a Miri context (if it just raised the signal normally then it would allow for debugging Miri itself, not the program being evaluated). As such, it just raises an error.
Add atomic min and max
Closes#1718
Previous attempt: #1653
TODO:
- [x] Merge `atomic_op` and `atomic_min_max` functions
- [x] Fix CI
**Note:** this PR also removes arbitrary trailing whitespace and generally formats the affected files
add date to Zulip notification subject
We sometimes have discussions in those threads; let's make sure we have a new thread for each new day (which likely means a new problem... or nobody got around to fixing things yet^^).