diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2021-09-08 12:24:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 12:24:14 -0400 |
| commit | 2f2aed1de7d7c7f0dd943635188078f810e1d468 (patch) | |
| tree | c0fcd9d2477776d42f6e9cf329c9ea3d5eb94b57 /src/test | |
| parent | c9db3e0fbc84d8409285698486375f080d361ef3 (diff) | |
| parent | c0451f73b2094d7edccb77d7ea8be48f64887e67 (diff) | |
| download | rust-2f2aed1de7d7c7f0dd943635188078f810e1d468.tar.gz rust-2f2aed1de7d7c7f0dd943635188078f810e1d468.zip | |
Rollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelid
Rustdoc: Report Layout of enum variants Followup of #83501, Fixes #86253. cc `@camelid` `@rustbot` label A-rustdoc
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/type-layout.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/rustdoc/type-layout.rs b/src/test/rustdoc/type-layout.rs index 272911de681..0868486fa59 100644 --- a/src/test/rustdoc/type-layout.rs +++ b/src/test/rustdoc/type-layout.rs @@ -52,3 +52,21 @@ pub struct Unsized([u8]); // @!has type_layout/trait.MyTrait.html 'Size: ' pub trait MyTrait {} + +// @has type_layout/enum.Variants.html 'Size: ' +// @has - '2 bytes' +// @has - '<code>A</code>: 0 bytes' +// @has - '<code>B</code>: 1 byte' +pub enum Variants { + A, + B(u8), +} + +// @has type_layout/enum.WithNiche.html 'Size: ' +// @has - //p '4 bytes' +// @has - '<code>None</code>: 0 bytes' +// @has - '<code>Some</code>: 4 bytes' +pub enum WithNiche { + None, + Some(std::num::NonZeroU32), +} |
