Auto merge of #121900 - chenyukang:yukang-fix-121425-repr-pack-error, r=compiler-errors

Fix misleading message in struct repr alignment and packed

Fixes #121425

By the way, fix the spans for the argument in the second commit.
This commit is contained in:
bors 2024-03-04 05:32:26 +00:00
commit f7cb53e54b
9 changed files with 160 additions and 49 deletions

View file

@ -441,7 +441,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
.map_err(|msg| {
struct_span_code_err!(
tcx.dcx(),
attr.span,
literal.span,
E0589,
"invalid `repr(align)` attribute: {}",
msg