repr(align) <= 4 should still be byval

This commit is contained in:
Erik Desjardins 2023-06-11 17:05:26 -04:00
parent 2591c30eaf
commit 7e933b4e26
13 changed files with 120 additions and 107 deletions

View File

@ -40,7 +40,7 @@ pub trait LayoutCalculator {
largest_niche, largest_niche,
align, align,
size, size,
has_repr_align: false, repr_align: None,
} }
} }
@ -123,7 +123,7 @@ pub trait LayoutCalculator {
largest_niche: None, largest_niche: None,
align: dl.i8_align, align: dl.i8_align,
size: Size::ZERO, size: Size::ZERO,
has_repr_align: false, repr_align: None,
} }
} }
@ -424,7 +424,7 @@ pub trait LayoutCalculator {
largest_niche, largest_niche,
size, size,
align, align,
has_repr_align: repr.align.is_some(), repr_align: repr.align,
}; };
Some(TmpLayout { layout, variants: variant_layouts }) Some(TmpLayout { layout, variants: variant_layouts })
@ -694,7 +694,7 @@ pub trait LayoutCalculator {
abi, abi,
align, align,
size, size,
has_repr_align: repr.align.is_some(), repr_align: repr.align,
}; };
let tagged_layout = TmpLayout { layout: tagged_layout, variants: layout_variants }; let tagged_layout = TmpLayout { layout: tagged_layout, variants: layout_variants };
@ -813,7 +813,7 @@ pub trait LayoutCalculator {
largest_niche: None, largest_niche: None,
align, align,
size: size.align_to(align.abi), size: size.align_to(align.abi),
has_repr_align: repr.align.is_some(), repr_align: repr.align,
}) })
} }
} }
@ -1111,9 +1111,9 @@ fn univariant(
abi = Abi::Uninhabited; abi = Abi::Uninhabited;
} }
let has_repr_align = repr.align.is_some() let repr_align = repr.align.or_else(|| {
|| repr.transparent() if repr.transparent() { layout_of_single_non_zst_field?.repr_align() } else { None }
&& layout_of_single_non_zst_field.map_or(false, |l| l.has_repr_align()); });
Some(LayoutS { Some(LayoutS {
variants: Variants::Single { index: FIRST_VARIANT }, variants: Variants::Single { index: FIRST_VARIANT },
@ -1122,7 +1122,7 @@ fn univariant(
largest_niche, largest_niche,
align, align,
size, size,
has_repr_align, repr_align,
}) })
} }

View File

@ -1532,10 +1532,10 @@ pub struct LayoutS {
pub align: AbiAndPrefAlign, pub align: AbiAndPrefAlign,
pub size: Size, pub size: Size,
/// True if the alignment was explicitly requested with `repr(align)`. /// The alignment explicitly requested with `repr(align)`.
/// Only used on i686-windows, where the argument passing ABI is different when alignment is /// Only used on i686-windows, where the argument passing ABI is different when alignment is
/// requested, even if the requested alignment is equal to or less than the natural alignment. /// requested, even if the requested alignment is equal to the natural alignment.
pub has_repr_align: bool, pub repr_align: Option<Align>,
} }
impl LayoutS { impl LayoutS {
@ -1550,7 +1550,7 @@ impl LayoutS {
largest_niche, largest_niche,
size, size,
align, align,
has_repr_align: false, repr_align: None,
} }
} }
} }
@ -1560,7 +1560,7 @@ impl fmt::Debug for LayoutS {
// This is how `Layout` used to print before it become // This is how `Layout` used to print before it become
// `Interned<LayoutS>`. We print it like this to avoid having to update // `Interned<LayoutS>`. We print it like this to avoid having to update
// expected output in a lot of tests. // expected output in a lot of tests.
let LayoutS { size, align, abi, fields, largest_niche, variants, has_repr_align } = self; let LayoutS { size, align, abi, fields, largest_niche, variants, repr_align } = self;
f.debug_struct("Layout") f.debug_struct("Layout")
.field("size", size) .field("size", size)
.field("align", align) .field("align", align)
@ -1568,7 +1568,7 @@ impl fmt::Debug for LayoutS {
.field("fields", fields) .field("fields", fields)
.field("largest_niche", largest_niche) .field("largest_niche", largest_niche)
.field("variants", variants) .field("variants", variants)
.field("has_repr_align", has_repr_align) .field("repr_align", repr_align)
.finish() .finish()
} }
} }
@ -1609,8 +1609,8 @@ impl<'a> Layout<'a> {
self.0.0.size self.0.0.size
} }
pub fn has_repr_align(self) -> bool { pub fn repr_align(self) -> Option<Align> {
self.0.0.has_repr_align self.0.0.repr_align
} }
/// Whether the layout is from a type that implements [`std::marker::PointerLike`]. /// Whether the layout is from a type that implements [`std::marker::PointerLike`].

View File

@ -83,7 +83,7 @@ pub(super) fn add_local_place_comments<'tcx>(
let rustc_target::abi::LayoutS { let rustc_target::abi::LayoutS {
size, size,
align, align,
has_repr_align: _, repr_align: _,
abi: _, abi: _,
variants: _, variants: _,
fields: _, fields: _,

View File

@ -755,7 +755,7 @@ where
largest_niche: None, largest_niche: None,
align: tcx.data_layout.i8_align, align: tcx.data_layout.i8_align,
size: Size::ZERO, size: Size::ZERO,
has_repr_align: false, repr_align: None,
}) })
} }

View File

@ -63,8 +63,8 @@ where
if t.is_like_msvc if t.is_like_msvc
&& arg.layout.is_adt() && arg.layout.is_adt()
&& arg.layout.has_repr_align && let Some(repr_align) = arg.layout.repr_align
&& arg.layout.align.abi > align_4 && repr_align > align_4
{ {
// MSVC has special rules for overaligned arguments: https://reviews.llvm.org/D72114. // MSVC has special rules for overaligned arguments: https://reviews.llvm.org/D72114.
// Summarized here: // Summarized here:
@ -72,6 +72,10 @@ where
// - For backwards compatibility, arguments with natural alignment > 4 are still passed // - For backwards compatibility, arguments with natural alignment > 4 are still passed
// on stack (via `byval`). For example, this includes `double`, `int64_t`, // on stack (via `byval`). For example, this includes `double`, `int64_t`,
// and structs containing them, provided they lack an explicit alignment attribute. // and structs containing them, provided they lack an explicit alignment attribute.
assert!(arg.layout.align.abi >= repr_align,
"abi alignment {:?} less than requested alignment {repr_align:?}",
arg.layout.align.abi,
);
arg.make_indirect(); arg.make_indirect();
} else if arg.layout.is_aggregate() { } else if arg.layout.is_aggregate() {
// We need to compute the alignment of the `byval` argument. The rules can be found in // We need to compute the alignment of the `byval` argument. The rules can be found in

View File

@ -258,7 +258,7 @@ fn layout_of_uncached<'tcx>(
largest_niche, largest_niche,
align: element.align, align: element.align,
size, size,
has_repr_align: false, repr_align: None,
}) })
} }
ty::Slice(element) => { ty::Slice(element) => {
@ -270,7 +270,7 @@ fn layout_of_uncached<'tcx>(
largest_niche: None, largest_niche: None,
align: element.align, align: element.align,
size: Size::ZERO, size: Size::ZERO,
has_repr_align: false, repr_align: None,
}) })
} }
ty::Str => tcx.mk_layout(LayoutS { ty::Str => tcx.mk_layout(LayoutS {
@ -280,7 +280,7 @@ fn layout_of_uncached<'tcx>(
largest_niche: None, largest_niche: None,
align: dl.i8_align, align: dl.i8_align,
size: Size::ZERO, size: Size::ZERO,
has_repr_align: false, repr_align: None,
}), }),
// Odd unit types. // Odd unit types.
@ -434,7 +434,7 @@ fn layout_of_uncached<'tcx>(
largest_niche: e_ly.largest_niche, largest_niche: e_ly.largest_niche,
size, size,
align, align,
has_repr_align: false, repr_align: None,
}) })
} }
@ -883,7 +883,7 @@ fn generator_layout<'tcx>(
largest_niche: prefix.largest_niche, largest_niche: prefix.largest_niche,
size, size,
align, align,
has_repr_align: false, repr_align: None,
}); });
debug!("generator layout ({:?}): {:#?}", ty, layout); debug!("generator layout ({:?}): {:#?}", ty, layout);
Ok(layout) Ok(layout)

View File

@ -71,17 +71,16 @@ pub struct ForceAlign8 {
c: i64 c: i64
} }
// On i686-windows, this is passed by reference because alignment is requested, // On i686-windows, this is passed on stack, because requested alignment is <=4.
// even though the requested alignment is less than the natural alignment.
#[repr(C)] #[repr(C)]
#[repr(align(1))] #[repr(align(4))]
pub struct LowerFA8 { pub struct LowerFA8 {
a: i64, a: i64,
b: i64, b: i64,
c: i64 c: i64
} }
// On i686-windows, this is passed on stack again, because the wrapper struct does not have // On i686-windows, this is passed on stack, because the wrapper struct does not have
// requested/forced alignment. // requested/forced alignment.
#[repr(C)] #[repr(C)]
pub struct WrappedFA8 { pub struct WrappedFA8 {
@ -287,9 +286,7 @@ extern "C" {
// i686-linux: declare void @lower_fa8({{.*}}byval(%LowerFA8) align 4{{.*}}) // i686-linux: declare void @lower_fa8({{.*}}byval(%LowerFA8) align 4{{.*}})
// i686-windows: declare void @lower_fa8( // i686-windows: declare void @lower_fa8({{.*}}byval(%LowerFA8) align 4{{.*}})
// i686-windows-NOT: byval
// i686-windows-SAME: align 8{{.*}})
fn lower_fa8(x: LowerFA8); fn lower_fa8(x: LowerFA8);
// m68k: declare void @wrapped_fa8({{.*}}byval(%WrappedFA8) align 8{{.*}}) // m68k: declare void @wrapped_fa8({{.*}}byval(%WrappedFA8) align 8{{.*}})

View File

@ -53,7 +53,7 @@ error: layout_of(E) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(12 bytes), size: Size(12 bytes),
@ -78,11 +78,11 @@ error: layout_of(E) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:7:1 --> $DIR/debug.rs:7:1
| |
@ -127,7 +127,7 @@ error: layout_of(S) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:10:1 --> $DIR/debug.rs:10:1
| |
@ -150,7 +150,7 @@ error: layout_of(U) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:13:1 --> $DIR/debug.rs:13:1
| |
@ -242,7 +242,7 @@ error: layout_of(std::result::Result<i32, i32>) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(8 bytes), size: Size(8 bytes),
@ -278,11 +278,11 @@ error: layout_of(std::result::Result<i32, i32>) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:16:1 --> $DIR/debug.rs:16:1
| |
@ -309,7 +309,7 @@ error: layout_of(i32) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:19:1 --> $DIR/debug.rs:19:1
| |
@ -332,7 +332,7 @@ error: layout_of(V) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:22:1 --> $DIR/debug.rs:22:1
| |
@ -355,7 +355,7 @@ error: layout_of(W) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:28:1 --> $DIR/debug.rs:28:1
| |
@ -378,7 +378,7 @@ error: layout_of(Y) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:34:1 --> $DIR/debug.rs:34:1
| |
@ -401,7 +401,7 @@ error: layout_of(P1) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:41:1 --> $DIR/debug.rs:41:1
| |
@ -424,7 +424,7 @@ error: layout_of(P2) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:45:1 --> $DIR/debug.rs:45:1
| |
@ -447,7 +447,7 @@ error: layout_of(P3) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:53:1 --> $DIR/debug.rs:53:1
| |
@ -470,7 +470,7 @@ error: layout_of(P4) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:57:1 --> $DIR/debug.rs:57:1
| |
@ -498,7 +498,7 @@ error: layout_of(P5) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:61:1 --> $DIR/debug.rs:61:1
| |
@ -526,7 +526,7 @@ error: layout_of(std::mem::MaybeUninit<u8>) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/debug.rs:64:1 --> $DIR/debug.rs:64:1
| |

View File

@ -59,11 +59,11 @@ error: layout_of(A) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/hexagon-enum.rs:16:1 --> $DIR/hexagon-enum.rs:16:1
| |
@ -131,11 +131,11 @@ error: layout_of(B) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/hexagon-enum.rs:20:1 --> $DIR/hexagon-enum.rs:20:1
| |
@ -203,11 +203,11 @@ error: layout_of(C) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/hexagon-enum.rs:24:1 --> $DIR/hexagon-enum.rs:24:1
| |
@ -275,11 +275,11 @@ error: layout_of(P) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/hexagon-enum.rs:28:1 --> $DIR/hexagon-enum.rs:28:1
| |
@ -347,11 +347,11 @@ error: layout_of(T) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/hexagon-enum.rs:34:1 --> $DIR/hexagon-enum.rs:34:1
| |

View File

@ -81,7 +81,7 @@ error: layout_of(MissingPayloadField) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(1 bytes), size: Size(1 bytes),
@ -100,11 +100,11 @@ error: layout_of(MissingPayloadField) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1 --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1
| |
@ -196,7 +196,7 @@ error: layout_of(CommonPayloadField) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(2 bytes), size: Size(2 bytes),
@ -232,11 +232,11 @@ error: layout_of(CommonPayloadField) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1 --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1
| |
@ -326,7 +326,7 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(2 bytes), size: Size(2 bytes),
@ -361,11 +361,11 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1 --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1
| |
@ -471,7 +471,7 @@ error: layout_of(NicheFirst) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(0 bytes), size: Size(0 bytes),
@ -490,7 +490,7 @@ error: layout_of(NicheFirst) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(0 bytes), size: Size(0 bytes),
@ -509,11 +509,11 @@ error: layout_of(NicheFirst) = Layout {
variants: Single { variants: Single {
index: 2, index: 2,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1 --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1
| |
@ -619,7 +619,7 @@ error: layout_of(NicheSecond) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(0 bytes), size: Size(0 bytes),
@ -638,7 +638,7 @@ error: layout_of(NicheSecond) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(0 bytes), size: Size(0 bytes),
@ -657,11 +657,11 @@ error: layout_of(NicheSecond) = Layout {
variants: Single { variants: Single {
index: 2, index: 2,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1 --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1
| |

View File

@ -53,7 +53,9 @@ error: layout_of(Aligned1) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: true, repr_align: Some(
Align(8 bytes),
),
}, },
Layout { Layout {
size: Size(8 bytes), size: Size(8 bytes),
@ -72,11 +74,15 @@ error: layout_of(Aligned1) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: true, repr_align: Some(
Align(8 bytes),
),
}, },
], ],
}, },
has_repr_align: true, repr_align: Some(
Align(8 bytes),
),
} }
--> $DIR/issue-96185-overaligned-enum.rs:8:1 --> $DIR/issue-96185-overaligned-enum.rs:8:1
| |
@ -144,7 +150,9 @@ error: layout_of(Aligned2) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: true, repr_align: Some(
Align(1 bytes),
),
}, },
Layout { Layout {
size: Size(1 bytes), size: Size(1 bytes),
@ -163,11 +171,15 @@ error: layout_of(Aligned2) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: true, repr_align: Some(
Align(1 bytes),
),
}, },
], ],
}, },
has_repr_align: true, repr_align: Some(
Align(1 bytes),
),
} }
--> $DIR/issue-96185-overaligned-enum.rs:16:1 --> $DIR/issue-96185-overaligned-enum.rs:16:1
| |

View File

@ -59,11 +59,11 @@ error: layout_of(A) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/thumb-enum.rs:16:1 --> $DIR/thumb-enum.rs:16:1
| |
@ -131,11 +131,11 @@ error: layout_of(B) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/thumb-enum.rs:20:1 --> $DIR/thumb-enum.rs:20:1
| |
@ -203,11 +203,11 @@ error: layout_of(C) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/thumb-enum.rs:24:1 --> $DIR/thumb-enum.rs:24:1
| |
@ -275,11 +275,11 @@ error: layout_of(P) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/thumb-enum.rs:28:1 --> $DIR/thumb-enum.rs:28:1
| |
@ -347,11 +347,11 @@ error: layout_of(T) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/thumb-enum.rs:34:1 --> $DIR/thumb-enum.rs:34:1
| |

View File

@ -57,7 +57,7 @@ error: layout_of(std::result::Result<[u32; 0], bool>) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(2 bytes), size: Size(2 bytes),
@ -89,11 +89,11 @@ error: layout_of(std::result::Result<[u32; 0], bool>) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/zero-sized-array-enum-niche.rs:13:1 --> $DIR/zero-sized-array-enum-niche.rs:13:1
| |
@ -159,7 +159,7 @@ error: layout_of(MultipleAlignments) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(4 bytes), size: Size(4 bytes),
@ -182,7 +182,7 @@ error: layout_of(MultipleAlignments) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(2 bytes), size: Size(2 bytes),
@ -214,11 +214,11 @@ error: layout_of(MultipleAlignments) = Layout {
variants: Single { variants: Single {
index: 2, index: 2,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/zero-sized-array-enum-niche.rs:21:1 --> $DIR/zero-sized-array-enum-niche.rs:21:1
| |
@ -284,7 +284,7 @@ error: layout_of(std::result::Result<[u32; 0], Packed<std::num::NonZeroU16>>) =
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(3 bytes), size: Size(3 bytes),
@ -316,11 +316,11 @@ error: layout_of(std::result::Result<[u32; 0], Packed<std::num::NonZeroU16>>) =
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/zero-sized-array-enum-niche.rs:37:1 --> $DIR/zero-sized-array-enum-niche.rs:37:1
| |
@ -390,7 +390,7 @@ error: layout_of(std::result::Result<[u32; 0], Packed<U16IsZero>>) = Layout {
variants: Single { variants: Single {
index: 0, index: 0,
}, },
has_repr_align: false, repr_align: None,
}, },
Layout { Layout {
size: Size(2 bytes), size: Size(2 bytes),
@ -422,11 +422,11 @@ error: layout_of(std::result::Result<[u32; 0], Packed<U16IsZero>>) = Layout {
variants: Single { variants: Single {
index: 1, index: 1,
}, },
has_repr_align: false, repr_align: None,
}, },
], ],
}, },
has_repr_align: false, repr_align: None,
} }
--> $DIR/zero-sized-array-enum-niche.rs:44:1 --> $DIR/zero-sized-array-enum-niche.rs:44:1
| |