Skip to content

Commit bb17f71

Browse files
committed
also test with PhantomData
1 parent aca76d4 commit bb17f71

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/test/ui/consts/const-eval/issue-55541.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44

55
#![feature(extern_types, const_transmute)]
66

7+
use std::marker::PhantomData;
8+
79
extern "C" {
810
pub type ExternType;
911
}
1012
unsafe impl Sync for ExternType {}
13+
static MAGIC_FFI_STATIC: u8 = 42;
1114

1215
#[repr(transparent)]
1316
pub struct Wrapper(ExternType);
14-
15-
static MAGIC_FFI_STATIC: u8 = 42;
16-
1717
pub static MAGIC_FFI_REF: &'static Wrapper = unsafe {
1818
std::mem::transmute(&MAGIC_FFI_STATIC)
1919
};
2020

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+
2127
fn main() {}

0 commit comments

Comments
 (0)