-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-langRelevant to the language teamRelevant to the language team
Description
In crate A:
#[non_exhaustive]
pub struct UnitType {}
In crate B:
#[repr(transparent)]
pub struct TransparentThing(i32, UnitType);
I expected that to fail in crate B, because the reason crate A put #[non_exhaustive]
on the type was to allow it to get additional fields in the future, which would no longer allow it to work in repr(transparent)
.
But this actually compiles today, creating what I would consider an accidental semver hazard.
Esper89
Metadata
Metadata
Assignees
Labels
A-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-langRelevant to the language teamRelevant to the language team