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

"unsupported representation for univariant enum" when using the repr attribute with single-variant enums #12371

Closed
bstrie opened this issue Feb 18, 2014 · 1 comment

Comments

@bstrie
Copy link
Contributor

bstrie commented Feb 18, 2014

Reproduce:

#[repr(u8)] enum Bar { Foo }
fn main() {}

Error:

repr.rs:1:13: 1:29 error: unsupported representation for univariant enum
repr.rs:1 #[repr(u8)] enum Bar { Foo }
                      ^~~~~~~~~~~~~~~~
error: aborting due to previous error

@cmr was convinced that this ought to be fixed. #rust also produced an example of where this would be necessary, from GLib:

typedef enum {
    G_THREAD_ERROR_AGAIN /* Resource temporarily unavailable */
} GThreadError;
@alexcrichton
Copy link
Member

Closing as a dupe of #10292.

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
…andling, r=lnicola

vscode: fix extraEnv handling numeric values

fixes rust-lang#12363 by bringing the types more inline with the reality, and making `Env` not a lie.
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 7, 2024
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 7, 2024
…gression, r=flip1995

Fix `nonminimal_bool` lint regression

Fixes rust-lang#12371.
Fixes rust-lang#12369.

cc `@RalfJung`

The problem was an invalid condition. Shame on me...

changelog: Fix `nonminimal_bool` lint regression
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

2 participants