rust/tests/compile-fail
bors 732461b4cd Auto merge of #2045 - RalfJung:strict-provenance, r=RalfJung
add -Zmiri-strict-provenance

This implements [strict provenance](https://github.com/rust-lang/rust/issues/95228) in Miri. The only change is that casting an integer to a pointer does not even attempt to produce a good provenance for the given address; instead, it always uses the invalid provenance. This stricter than even `-Zmiri-tag-raw-pointers` in that it also rejects the following example (which does not even involve Stacked Borrows):
```rust
fn main() {
    let x = 22;
    let ptr = &x as *const _ as *const u8;
    let roundtrip = ptr as usize as *const u8;
    let _ = unsafe { roundtrip.offset(1) };
}
```
The new flag also implies `-Zmiri-tag-raw-pointers` since the only reason one would *not* want to tag raw pointers is to support ptr-int-ptr roundtrips.

Note that the flag does *not* check against ptr-to-int *transmutes*; that still requires `-Zmiri-check-number-validity`. You can also check for strict provenance *without* Stacked Borrows by adding `-Zmiri-disable-stacked-borrows`.

The new "Miri hard mode" flags for maximal checking are `-Zmiri-strict-provenance -Zmiri-check-number-validity`. (Add `-Zmiri-symbolic-alignment-check` if you feel extra spicy today.)
2022-04-01 22:40:26 +00:00
..
2021-11-01 16:12:38 -07:00
2022-02-25 12:06:10 -05:00
2022-04-01 14:10:24 -04:00
2021-03-04 07:48:28 -05:00
2021-10-05 13:13:06 -07:00
2021-01-31 13:12:25 +01:00
2021-05-03 10:08:42 -04:00
2021-04-25 16:57:48 +02:00
2022-03-24 10:06:33 -04:00
2022-03-24 10:06:33 -04:00
2022-03-26 11:08:11 -04:00
2021-02-23 09:23:49 +01:00
2021-11-10 11:36:42 -08:00
2021-06-06 10:33:46 +02:00
2021-07-16 10:10:12 +02:00
2021-03-25 12:44:30 +01:00
2021-07-16 10:10:12 +02:00