summaryrefslogtreecommitdiffstats
path: root/tests/rust/constant_user_defined_type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/constant_user_defined_type.rs')
-rw-r--r--tests/rust/constant_user_defined_type.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rust/constant_user_defined_type.rs b/tests/rust/constant_user_defined_type.rs
new file mode 100644
index 0000000..cffe817
--- /dev/null
+++ b/tests/rust/constant_user_defined_type.rs
@@ -0,0 +1,17 @@
+#[repr(C)]
+pub struct S {
+ field: u8,
+}
+
+/// cbindgen:enum-class=false
+#[repr(C)]
+pub enum E {
+ V,
+}
+use E::*;
+
+pub type A = u8;
+
+pub const C1: S = S { field: 0 };
+pub const C2: E = V;
+pub const C3: A = 0;