Skip to content

error[E0588]: packed type cannot transitively contain a [repr(align)] type does not clarify the transitive [repr(align)] type #67383

Closed
@samuela

Description

@samuela

I'm currently looking at an error

error[E0588]: packed type cannot transitively contain a `[repr(align)]` type
   --> networking/udhcp/d6_packet.rs:259:1
    |
259 | / pub struct ip6_udp_d6_packet {
260 | |   pub ip6: ip6_hdr,
261 | |   pub udp: udphdr,
262 | |   pub data: d6_packet,
263 | | }
    | |_^

which would be fine except that the error message doesn't clarify at all what the problematic transitive dependency is. It would be nice to have a message like

ip6_udp_d6_packet
    contains udphdr
    which contains foo
    which contains bar which is a `[repr(align)]` type

With sufficiently complex nesting of structs, it can be incredibly tedious to track down which struct is [repr(align)] (especially when the offending struct is from an external library).

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions