Auto merge of #2487 - RalfJung:rustup, r=RalfJung

rustup

Testing for nicer backtraces from https://github.com/rust-lang/rust/pull/100501.
This commit is contained in:
bors 2022-08-14 11:52:36 +00:00
commit a000764fb9
3 changed files with 5 additions and 4 deletions

View file

@ -1 +1 @@
75b7e52e92c3b00fc891b47f5b2efdff0a2be55a
2fbc08e2ce64dee45a29cb6133da6b32366268aa

View file

@ -1,6 +1,7 @@
//@compile-flags: -Zmiri-strict-provenance
#![feature(strict_provenance)]
fn main() {
let addr = &0 as *const i32 as usize;
let _ptr = addr as *const i32; //~ ERROR: integer-to-pointer casts and `ptr::from_exposed_addr` are not supported
let _ptr = std::ptr::from_exposed_addr::<i32>(addr); //~ ERROR: integer-to-pointer casts and `ptr::from_exposed_addr` are not supported
}

View file

@ -1,8 +1,8 @@
error: unsupported operation: integer-to-pointer casts and `ptr::from_exposed_addr` are not supported with `-Zmiri-strict-provenance`
--> $DIR/strict_provenance_cast.rs:LL:CC
|
LL | let _ptr = addr as *const i32;
| ^^^^^^^^^^^^^^^^^^ integer-to-pointer casts and `ptr::from_exposed_addr` are not supported with `-Zmiri-strict-provenance`
LL | let _ptr = std::ptr::from_exposed_addr::<i32>(addr);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer casts and `ptr::from_exposed_addr` are not supported with `-Zmiri-strict-provenance`
|
= help: use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead
= note: backtrace: