Refer to std derives by absolute path
This prevents hijacking if the caller's crate has a macro in
scope (via #[macro_use]) with the same name.
diff --git a/macro/src/expand.rs b/macro/src/expand.rs
index 411f87e..09373ff 100644
--- a/macro/src/expand.rs
+++ b/macro/src/expand.rs
@@ -164,10 +164,15 @@
pub const #variant_ident: Self = #ident { repr: #discriminant };
})
});
+ let derives = quote! {
+ // Required to be derived in order for the enum's "variants" to be
+ // usable in patterns.
+ #[derive(::std::cmp::PartialEq, ::std::cmp::Eq)]
+ };
quote! {
#doc
- #[derive(PartialEq, Eq)] // required to be derived in order to be usable in patterns
+ #derives
#[repr(transparent)]
pub struct #ident {
pub repr: #repr,