Fix proc macro
This commit is contained in:
parent
b5af5fbe70
commit
90d5661d12
2 changed files with 1 additions and 14 deletions
|
@ -1,5 +1,3 @@
|
|||
use reprc_proc_macro::DeriveReprC;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_reprc {
|
||||
(
|
||||
|
@ -20,17 +18,6 @@ macro_rules! impl_reprc {
|
|||
};
|
||||
}
|
||||
|
||||
impl_reprc!(
|
||||
struct Test {
|
||||
#[assume_reprc]
|
||||
i1: i32,
|
||||
#[assume_reprc]
|
||||
i2: i32,
|
||||
#[assume_reprc]
|
||||
v1: Vec<i32>,
|
||||
}
|
||||
);
|
||||
|
||||
pub unsafe trait ReprC {
|
||||
fn is_repr_c(&self) -> bool;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ pub fn reprc_builder(item: TokenStream) -> TokenStream {
|
|||
true
|
||||
|
||||
#(
|
||||
&& self. #reprc_fields.to_tokens() .is_repr_c()
|
||||
&& (&self. #reprc_fields as &dyn ReprC) .is_repr_c()
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue