diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-08-24 20:39:26 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-08-24 23:05:54 +0300 |
| commit | 06f2d73b2bd6f290a72d8041c957a08b3f6d50c7 (patch) | |
| tree | 8b9de3fc797b3162c0ce50e67700e7b6662f4246 /tests | |
| parent | b9033bdd92aa697dee77fa581c22d418b5bdf308 (diff) | |
| download | rust-06f2d73b2bd6f290a72d8041c957a08b3f6d50c7.tar.gz rust-06f2d73b2bd6f290a72d8041c957a08b3f6d50c7.zip | |
repr_transparent_external_private_fields: treat `rustc_pub_transparent` types as local
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/repr/repr-transparent-non-exhaustive-transparent-in-prose.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/repr/repr-transparent-non-exhaustive-transparent-in-prose.rs b/tests/ui/repr/repr-transparent-non-exhaustive-transparent-in-prose.rs new file mode 100644 index 00000000000..6ab34719f06 --- /dev/null +++ b/tests/ui/repr/repr-transparent-non-exhaustive-transparent-in-prose.rs @@ -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() {} |
