Skip to content

Formally define repr(u32, i8, etc...) and repr(C) on enums with payloads - #2195

Merged
aturon merged 5 commits into
rust-lang:masterfrom
Gankra:tag-youre-it
Feb 14, 2018
Merged

Formally define repr(u32, i8, etc...) and repr(C) on enums with payloads#2195
aturon merged 5 commits into
rust-lang:masterfrom
Gankra:tag-youre-it

Conversation

@Gankra

@Gankra Gankra commented Oct 31, 2017

Copy link
Copy Markdown
Contributor

Formally define the enum #[repr(u32, i8, etc..)] and #[repr(C)] attributes to force a non-C-like enum to have defined layouts. This serves two purposes: allowing low-level Rust code to independently initialize the tag and payload, and allowing C(++) to safely manipulate these types.

Rendered

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-data-types RFCs about data-types A-ffi FFI related proposals. A-machine Proposals relating to Rust's abstract machine. A-repr #[repr(...)] related proposals & ideas final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-lang Relevant to the language team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.