print-type-sizes: skip field printing for primitives#89329
print-type-sizes: skip field printing for primitives#89329bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
| Variants::Single { index } => { | ||
| debug!("print-type-size `{:#?}` variant {}", layout, adt_def.variants[index].ident); | ||
| if !adt_def.variants.is_empty() { | ||
| if !adt_def.variants.is_empty() && layout.fields != FieldsShape::Primitive { |
There was a problem hiding this comment.
Why is variants non-empty here? Primitives aren't enums.
There was a problem hiding this comment.
FieldsShape describes how fields are located in memory, with Primitive used for things that have no fields, including the never type.
Variants that are uninhabited and have ZST fields only are consider to be absent. Layout computation omits absents variants entirely. If all variants of an enum are absent, the layout of a never type is used (Variants::Single, FieldsShape::Primitive).
|
@bors r+ rollup |
|
📌 Commit 25b6f9b has been approved by |
… r=jackh726 print-type-sizes: skip field printing for primitives Fixes rust-lang#86528.
|
⌛ Testing commit 25b6f9b with merge 8a96e19d88d02dca3d3da0f1bfc3783ad561b695... |
|
💔 Test failed - checks-actions |
|
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot) |
…arth Rollup of 12 pull requests Successful merges: - rust-lang#87601 (Add functions to add unsigned and signed integers) - rust-lang#88523 (Expand documentation for `FpCategory`.) - rust-lang#89050 (refactor: VecDeques Drain fields to private) - rust-lang#89245 (refactor: make VecDeque's IterMut fields module-private, not just crate-private) - rust-lang#89324 (Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism`) - rust-lang#89329 (print-type-sizes: skip field printing for primitives) - rust-lang#89501 (Note specific regions involved in 'borrowed data escapes' error) - rust-lang#89506 (librustdoc: Use correct heading levels.) - rust-lang#89528 (Fix suggestion to borrow when casting from pointer to reference) - rust-lang#89531 (library std, libc dependency update) - rust-lang#89588 (Add a test for generic_const_exprs) - rust-lang#89591 (fix: alloc-optimisation is only for rust llvm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #86528.