Skip to content

Commit

Permalink
repr_transparent_external_private_fields: add a test for rust-lang#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Aug 24, 2024
1 parent f167efa commit a812d66
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//@ check-pass

#![feature(sync_unsafe_cell)]
#![allow(unused)]
#![deny(repr_transparent_external_private_fields)]

// https://github.com/rust-lang/rust/issues/129470

struct ZST;

#[repr(transparent)]
struct TransparentWithManuallyDropZST {
value: i32,
md: std::mem::ManuallyDrop<ZST>,
mu: std::mem::MaybeUninit<ZST>,
p: std::pin::Pin<ZST>,
pd: std::marker::PhantomData<ZST>,
pp: std::marker::PhantomPinned,
c: std::cell::Cell<ZST>,
uc: std::cell::UnsafeCell<ZST>,
suc: std::cell::SyncUnsafeCell<ZST>,
zst: ZST,
}

fn main() {}

0 comments on commit a812d66

Please sign in to comment.