print-type-sizes: skip field printing for primitives
This commit is contained in:
parent
1d71ba8623
commit
25b6f9b68b
@ -1805,8 +1805,11 @@ fn record_layout_for_printing_outlined(&self, layout: TyAndLayout<'tcx>) {
|
|||||||
|
|
||||||
match layout.variants {
|
match layout.variants {
|
||||||
Variants::Single { index } => {
|
Variants::Single { index } => {
|
||||||
debug!("print-type-size `{:#?}` variant {}", layout, adt_def.variants[index].ident);
|
if !adt_def.variants.is_empty() && layout.fields != FieldsShape::Primitive {
|
||||||
if !adt_def.variants.is_empty() {
|
debug!(
|
||||||
|
"print-type-size `{:#?}` variant {}",
|
||||||
|
layout, adt_def.variants[index].ident
|
||||||
|
);
|
||||||
let variant_def = &adt_def.variants[index];
|
let variant_def = &adt_def.variants[index];
|
||||||
let fields: Vec<_> = variant_def.fields.iter().map(|f| f.ident.name).collect();
|
let fields: Vec<_> = variant_def.fields.iter().map(|f| f.ident.name).collect();
|
||||||
record(
|
record(
|
||||||
|
@ -11,5 +11,5 @@
|
|||||||
fn start(_: isize, _: *const *const u8) -> isize {
|
fn start(_: isize, _: *const *const u8) -> isize {
|
||||||
let _x: Option<!> = None;
|
let _x: Option<!> = None;
|
||||||
let _y: Result<u32, !> = Ok(42);
|
let _y: Result<u32, !> = Ok(42);
|
||||||
0
|
let _z: Result<!, !> = loop {};
|
||||||
}
|
}
|
||||||
|
@ -3,3 +3,4 @@ print-type-size variant `Ok`: 4 bytes
|
|||||||
print-type-size field `.0`: 4 bytes
|
print-type-size field `.0`: 4 bytes
|
||||||
print-type-size type: `std::option::Option<!>`: 0 bytes, alignment: 1 bytes
|
print-type-size type: `std::option::Option<!>`: 0 bytes, alignment: 1 bytes
|
||||||
print-type-size variant `None`: 0 bytes
|
print-type-size variant `None`: 0 bytes
|
||||||
|
print-type-size type: `std::result::Result<!, !>`: 0 bytes, alignment: 1 bytes
|
||||||
|
Loading…
Reference in New Issue
Block a user