miri: fixup for allowing &raw UNSAFE_STATIC

This commit is contained in:
Jubilee Young 2024-05-31 23:40:11 -07:00
parent bf454afcaa
commit b3cd9b5cd3
3 changed files with 4 additions and 4 deletions

View File

@ -5,5 +5,5 @@ extern "C" {
}
fn main() {
let _val = unsafe { std::ptr::addr_of!(FOO) }; //~ ERROR: is not supported by Miri
let _val = std::ptr::addr_of!(FOO); //~ ERROR: is not supported by Miri
}

View File

@ -1,8 +1,8 @@
error: unsupported operation: extern static `FOO` is not supported by Miri
--> $DIR/extern_static.rs:LL:CC
|
LL | let _val = unsafe { std::ptr::addr_of!(FOO) };
| ^^^ extern static `FOO` is not supported by Miri
LL | let _val = std::ptr::addr_of!(FOO);
| ^^^ extern static `FOO` is not supported by Miri
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
= note: BACKTRACE:

View File

@ -2,7 +2,7 @@ use std::ptr::addr_of;
static mut FOO: i32 = 42;
static BAR: Foo = Foo(unsafe { addr_of!(FOO) });
static BAR: Foo = Foo(addr_of!(FOO));
#[allow(dead_code)]
struct Foo(*const i32);