Created
February 18, 2014 17:18
-
-
Save bstrie/9075358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repr.rs:5:5: 5:15 error: discriminant value outside specified type | |
repr.rs:5 Qux = 5000 | |
^~~~~~~~~~ | |
repr.rs:1:8: 1:10 note: discriminant type specified here | |
repr.rs:1 #[repr(i8)] | |
^~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[repr(i8)] | |
enum Foo { | |
Bar = 0, | |
Baz = 127, | |
Qux = 5000 | |
} | |
fn main() { | |
println!("{:i}", Qux as i8) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment