diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-01-11 03:07:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 03:07:26 -0800 |
commit | 6bfeae155155a12849033e1c5199ca6e48e8b22c (patch) | |
tree | 4b1a0e42b32238565eb3ab61e67623e13459a06f /libbindgen/tests | |
parent | df043bf3dcc11bfd5c22cee5d3c6ba04d41c5f00 (diff) | |
parent | fee7e96875f1d7c805a09e8ec8e02988de25e370 (diff) |
Auto merge of #393 - emilio:enum-const-api, r=upsuper
Provide an API to constify enum variants.
r? @upsuper
Diffstat (limited to 'libbindgen/tests')
-rw-r--r-- | libbindgen/tests/expectations/tests/constify-enum.rs | 20 | ||||
-rw-r--r-- | libbindgen/tests/headers/constify-enum.h | 13 |
2 files changed, 33 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/constify-enum.rs b/libbindgen/tests/expectations/tests/constify-enum.rs new file mode 100644 index 00000000..989c5197 --- /dev/null +++ b/libbindgen/tests/expectations/tests/constify-enum.rs @@ -0,0 +1,20 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: + nsCSSPropertyID = + nsCSSPropertyID::eCSSProperty_COUNT_unexistingVariantValue; +pub const nsCSSPropertyID_eCSSProperty_COUNT: nsCSSPropertyID = + nsCSSPropertyID::eCSSPropertyAlias_aa; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum nsCSSPropertyID { + eCSSProperty_a = 0, + eCSSProperty_b = 1, + eCSSPropertyAlias_aa = 2, + eCSSPropertyAlias_bb = 3, + eCSSProperty_COUNT_unexistingVariantValue = 4, +} diff --git a/libbindgen/tests/headers/constify-enum.h b/libbindgen/tests/headers/constify-enum.h new file mode 100644 index 00000000..a5b4052c --- /dev/null +++ b/libbindgen/tests/headers/constify-enum.h @@ -0,0 +1,13 @@ + +enum nsCSSPropertyID { + eCSSProperty_a, + eCSSProperty_b, + + eCSSProperty_COUNT, /**< <div rustbindgen constant></div> */ + eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1, /**< <div rustbindgen hide></div> */ + + eCSSPropertyAlias_aa, + eCSSPropertyAlias_bb, + + eCSSProperty_COUNT_unexistingVariantValue, /**< <div rustbindgen constant></div> */ +}; |