aboutsummaryrefslogtreecommitdiff
path: root/test_cases/info_tests/enum/methods.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_cases/info_tests/enum/methods.rs')
-rw-r--r--test_cases/info_tests/enum/methods.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test_cases/info_tests/enum/methods.rs b/test_cases/info_tests/enum/methods.rs
new file mode 100644
index 0000000..6f6ff89
--- /dev/null
+++ b/test_cases/info_tests/enum/methods.rs
@@ -0,0 +1,14 @@
+pub enum Foo {
+ Zero = 0,
+ One,
+ Two,
+ Three,
+}
+
+impl Foo {
+ // avoid issues with hash in mangled name
+ #[export_name = "Foo__to_u32"]
+ pub fn to_u32(self) -> u32 {
+ self as u32
+ }
+}