diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2023-08-15 10:10:35 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2023-09-18 19:30:10 +0200 |
| commit | 64fa12a4fb1447e3368ae2cd08cf75ea576997ea (patch) | |
| tree | 3466dd26ba23f85690b56604d89b7b54af3f77e4 /tests/rustdoc/inline_cross/auxiliary | |
| parent | cbcf9a5368c0d8b6d0b5784201471475cb3496a3 (diff) | |
| download | rust-64fa12a4fb1447e3368ae2cd08cf75ea576997ea.tar.gz rust-64fa12a4fb1447e3368ae2cd08cf75ea576997ea.zip | |
rustdoc: hide repr(transparent) if it isn't part of the public ABI
Diffstat (limited to 'tests/rustdoc/inline_cross/auxiliary')
| -rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/attributes.rs | 2 | ||||
| -rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/repr.rs | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/rustdoc/inline_cross/auxiliary/attributes.rs b/tests/rustdoc/inline_cross/auxiliary/attributes.rs new file mode 100644 index 00000000000..c6f155d4ba5 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/attributes.rs @@ -0,0 +1,2 @@ +#[non_exhaustive] +pub struct NonExhaustive; diff --git a/tests/rustdoc/inline_cross/auxiliary/repr.rs b/tests/rustdoc/inline_cross/auxiliary/repr.rs index 4a6648a6439..35f08c11b7b 100644 --- a/tests/rustdoc/inline_cross/auxiliary/repr.rs +++ b/tests/rustdoc/inline_cross/auxiliary/repr.rs @@ -10,7 +10,7 @@ pub struct ReprSimd { } #[repr(transparent)] pub struct ReprTransparent { - field: u8, + pub field: u8, } #[repr(isize)] pub enum ReprIsize { @@ -20,3 +20,23 @@ pub enum ReprIsize { pub enum ReprU8 { Bla, } + +#[repr(transparent)] // private +pub struct ReprTransparentPrivField { + field: u32, // non-1-ZST field +} + +#[repr(transparent)] // public +pub struct ReprTransparentPriv1ZstFields { + marker0: Marker, + pub main: u64, // non-1-ZST field + marker1: Marker, +} + +#[repr(transparent)] // private +pub struct ReprTransparentPrivFieldPub1ZstFields { + main: [u16; 0], // non-1-ZST field + pub marker: Marker, +} + +pub struct Marker; // 1-ZST |
