We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aca76d4 commit bb17f71Copy full SHA for bb17f71
src/test/ui/consts/const-eval/issue-55541.rs
@@ -4,18 +4,24 @@
4
5
#![feature(extern_types, const_transmute)]
6
7
+use std::marker::PhantomData;
8
+
9
extern "C" {
10
pub type ExternType;
11
}
12
unsafe impl Sync for ExternType {}
13
+static MAGIC_FFI_STATIC: u8 = 42;
14
15
#[repr(transparent)]
16
pub struct Wrapper(ExternType);
-
-static MAGIC_FFI_STATIC: u8 = 42;
17
pub static MAGIC_FFI_REF: &'static Wrapper = unsafe {
18
std::mem::transmute(&MAGIC_FFI_STATIC)
19
};
20
21
+#[repr(transparent)]
22
+pub struct Wrapper2(PhantomData<Vec<i32>>, ExternType);
23
+pub static MAGIC_FFI_REF2: &'static Wrapper2 = unsafe {
24
+ std::mem::transmute(&MAGIC_FFI_STATIC)
25
+};
26
27
fn main() {}
0 commit comments