mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
797f247997
Modify the linting behavior and add the corresponding regression test
23 lines
449 B
Rust
23 lines
449 B
Rust
// This is a regression test for issue https://github.com/rust-lang/rust/issues/106629.
|
|
// It ensures that transparent types where all fields are PhantomData are marked as
|
|
// FFI-safe.
|
|
|
|
// check-pass
|
|
|
|
#[repr(transparent)]
|
|
#[derive(Copy, Clone)]
|
|
struct MyPhantom(core::marker::PhantomData<u8>);
|
|
|
|
#[repr(C)]
|
|
#[derive(Copy, Clone)]
|
|
pub struct Bar {
|
|
pub x: i32,
|
|
_marker: MyPhantom,
|
|
}
|
|
|
|
extern "C" {
|
|
pub fn foo(bar: *mut Bar);
|
|
}
|
|
|
|
fn main() {}
|