Skip to content
Merged

rustup #2487

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
75b7e52e92c3b00fc891b47f5b2efdff0a2be55a
2fbc08e2ce64dee45a29cb6133da6b32366268aa
3 changes: 2 additions & 1 deletion tests/fail/provenance/strict_provenance_cast.rs
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions tests/fail/provenance/strict_provenance_cast.stderr
Original file line number Diff line number Diff line change
@@ -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:
Expand Down