Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum: "bitfield" and "rustified" shouldn't be mutually exclusive #1165

Closed
tamird opened this issue Nov 29, 2017 · 5 comments
Closed

enum: "bitfield" and "rustified" shouldn't be mutually exclusive #1165

tamird opened this issue Nov 29, 2017 · 5 comments

Comments

@tamird
Copy link
Contributor

tamird commented Nov 29, 2017

Providing the two together should provide an API similar to that produced by usage of the bitflags crate.

@nox
Copy link
Contributor

nox commented Nov 29, 2017

That's not an obvious thing to do without #[repr(transparent)]. For any given T type with #[repr(C)], T and #[repr(C)] struct Wrapper(T) won't necessarily behave the same on some ABIs.

@nox
Copy link
Contributor

nox commented Nov 29, 2017

Though I just remembered that's already a problem with "bitfield" on its own, IIRC.

@emilio
Copy link
Contributor

emilio commented Nov 29, 2017

Yeah, but more to the point, bitfield + rustified is a no-go because of rust match semantics, see #225. Having out-of-range rust enums is UB.

@emilio emilio closed this as completed Nov 29, 2017
@tamird
Copy link
Contributor Author

tamird commented Nov 29, 2017

Ah, sorry, I should have titled this differently - I don't need the enum part, I just need it to be associated constant-y. Should I open a new issue for non-rustified associated constant enums?

@emilio
Copy link
Contributor

emilio commented Nov 29, 2017

Wait, you mean generating them in their own modules? Ok, yeah, that should be doable :)

But yeah, let's file another issue for them, since this one has nothing related to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants