mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-24 01:52:27 +00:00
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.
This commit is contained in:
parent
2c24e5cb84
commit
0521373464
@ -164,10 +164,15 @@ fn expand_enum(enm: &Enum) -> TokenStream {
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user