From 90d5661d12c38acca0b312fca1fb778d1bd98728 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Wed, 1 Feb 2023 13:21:47 +0100 Subject: [PATCH] Fix proc macro --- src/repr_c.rs | 13 ------------- src/reprc_proc_macro/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/repr_c.rs b/src/repr_c.rs index 416166b..987678e 100644 --- a/src/repr_c.rs +++ b/src/repr_c.rs @@ -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, - } -); - pub unsafe trait ReprC { fn is_repr_c(&self) -> bool; } diff --git a/src/reprc_proc_macro/src/lib.rs b/src/reprc_proc_macro/src/lib.rs index 6d5d9f9..d7a6768 100644 --- a/src/reprc_proc_macro/src/lib.rs +++ b/src/reprc_proc_macro/src/lib.rs @@ -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() )* } }