From 82362b7c4797b516c35403ae0bae087f521fa054 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 28 Oct 2023 01:49:07 +0200 Subject: [PATCH] fix(sol-macro): keep more attributes on contract module --- crates/sol-macro/src/expand/contract.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/sol-macro/src/expand/contract.rs b/crates/sol-macro/src/expand/contract.rs index 13508a2c3..76390829f 100644 --- a/crates/sol-macro/src/expand/contract.rs +++ b/crates/sol-macro/src/expand/contract.rs @@ -59,8 +59,14 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, contract: &ItemContract) -> Result, _) = + let (mut mod_attrs, item_attrs): (Vec<_>, _) = attrs.into_iter().partition(|a| a.path().is_ident("doc")); + mod_attrs.extend( + item_attrs + .iter() + .filter(|a| !a.path().is_ident("derive")) + .cloned(), + ); for item in body { match item {