]> git.lizzy.rs Git - enumset.git/blobdiff - enumset/tests/compile-fail/variants.rs
Add `repr` option to derive.
[enumset.git] / enumset / tests / compile-fail / variants.rs
index bfa9c11993e518206a90b4df56a59d9d34a01f9f..2b76a40897635a816bcff3d035d99372ac0ec7f3 100644 (file)
@@ -49,4 +49,17 @@ struct BadItemType {
 
 }
 
-fn main() { }
\ No newline at end of file
+#[derive(EnumSetType)]
+#[enumset(repr = "u16")]
+enum BadMemRepr {
+    Variant = 16,
+}
+
+#[derive(EnumSetType)]
+enum OkayEnumButCantUseFromRepr {
+    Variant,
+}
+
+fn main() {
+    EnumSet::<OkayEnumButCantUseFromRepr>::from_repr(1);
+}