Skip to content

The seemingly contradictory #[repr(Rust, C)] is allowed #116825

Closed
@fmease

Description

@fmease

#[repr(Rust)] is already on beta and will soon hit stable.

I just found out that #[repr(C, Rust)] successfully compiles while I expected it to error due to contradictory representations.

Further, I wonder if #[repr(Rust, transparent)] should be allowed? Currently it errors with E0692, transparent struct cannot have other repr hints. (see err's response)

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-reprArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions