1
Fork 0

Auto merge of #122972 - beetrees:use-align-type, r=fee1-dead

Use the `Align` type when parsing alignment attributes

Use the `Align` type in `rustc_attr::parse_alignment`, removing the need to call `Align::from_bytes(...).unwrap()` later in the compilation process.
This commit is contained in:
bors 2024-04-01 03:16:45 +00:00
commit defef8658e
12 changed files with 74 additions and 26 deletions

View file

@ -964,7 +964,7 @@ pub(super) fn check_packed(tcx: TyCtxt<'_>, sp: Span, def: ty::AdtDef<'_>) {
for r in attr::parse_repr_attr(tcx.sess, attr) {
if let attr::ReprPacked(pack) = r
&& let Some(repr_pack) = repr.pack
&& pack as u64 != repr_pack.bytes()
&& pack != repr_pack
{
struct_span_code_err!(
tcx.dcx(),