diff --git a/Cargo.toml b/Cargo.toml index 5eb5a88..5a3f097 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ exclude = [ [workspace.package] authors = ["Antonio Yang "] -version = "0.12.3" +version = "0.12.4" edition = "2021" categories = ["development-tools"] keywords = ["struct", "patch", "macro", "derive", "overlay"] diff --git a/complex-example/Cargo.toml b/complex-example/Cargo.toml index 1c0028c..4ba5e4b 100644 --- a/complex-example/Cargo.toml +++ b/complex-example/Cargo.toml @@ -9,7 +9,7 @@ struct-patch = { path = "../lib", features = ["catalyst"] } [workspace.package] authors = ["Antonio Yang "] -version = "0.12.3" +version = "0.12.4" edition = "2021" categories = ["development-tools"] keywords = ["struct", "patch", "macro", "derive", "overlay"] diff --git a/derive/src/catalyst.rs b/derive/src/catalyst.rs index 6ec7199..6d65d93 100644 --- a/derive/src/catalyst.rs +++ b/derive/src/catalyst.rs @@ -103,6 +103,7 @@ impl Catalyst { }) .collect::>(); let catalyst_impl = quote! { + #[automatically_derived] impl struct_patch::traits::Catalyst < #substrate_name, #complex_struct_name > for #struct_name { fn bind(self, s: #substrate_name) -> #complex_struct_name { let ( @@ -123,6 +124,7 @@ impl Catalyst { #(#complex_fields)* } + #[automatically_derived] impl struct_patch::traits::Complex < #struct_name, #substrate_name > for #complex_struct_name { fn decouple(self) -> (#struct_name, #substrate_name) { let #complex_struct_name { diff --git a/derive/src/filler.rs b/derive/src/filler.rs index 7e1b30d..0c76d1f 100644 --- a/derive/src/filler.rs +++ b/derive/src/filler.rs @@ -142,6 +142,7 @@ impl Filler { #[cfg(feature = "status")] let status_impl = quote!( + #[automatically_derived] impl #generics struct_patch::traits::Status for #name #generics #where_clause { fn is_empty(&self) -> bool { #( @@ -168,6 +169,7 @@ impl Filler { #[cfg(feature = "op")] let op_impl = quote! { + #[automatically_derived] impl #generics core::ops::Shl<#name #generics> for #struct_name #generics #where_clause { type Output = Self; @@ -177,6 +179,7 @@ impl Filler { } } + #[automatically_derived] impl #generics core::ops::Add for #name #generics #where_clause { type Output = Self; @@ -223,6 +226,7 @@ impl Filler { let op_impl = quote!(); let filler_impl = quote! { + #[automatically_derived] impl #generics struct_patch::traits::Filler< #name #generics > for #struct_name #generics #where_clause { fn apply(&mut self, filler: #name #generics) { #( diff --git a/derive/src/patch.rs b/derive/src/patch.rs index 76eec67..0a18586 100644 --- a/derive/src/patch.rs +++ b/derive/src/patch.rs @@ -194,6 +194,7 @@ impl Patch { #[cfg(feature = "status")] let patch_status_impl = quote!( + #[automatically_derived] impl #generics struct_patch::traits::Status for #name #generics #where_clause { fn is_empty(&self) -> bool { #( @@ -220,6 +221,7 @@ impl Patch { #[cfg(feature = "merge")] let patch_merge_impl = quote!( + #[automatically_derived] impl #generics struct_patch::traits::Merge for #name #generics #where_clause { fn merge(self, other: Self) -> Self { Self { @@ -290,6 +292,7 @@ impl Patch { #[cfg(all(feature = "op", not(feature = "merge")))] let op_impl = quote! { + #[automatically_derived] impl #generics core::ops::Shl<#name #generics> for #struct_name #generics #where_clause { type Output = Self; @@ -299,6 +302,7 @@ impl Patch { } } + #[automatically_derived] impl #generics core::ops::Add for #name #generics #where_clause { type Output = Self; @@ -358,6 +362,7 @@ impl Patch { #[cfg(all(feature = "op", feature = "merge"))] let op_impl = quote! { + #[automatically_derived] impl #generics core::ops::Shl<#name #generics> for #struct_name #generics #where_clause { type Output = Self; @@ -367,6 +372,7 @@ impl Patch { } } + #[automatically_derived] impl #generics core::ops::Shl<#name #generics> for #name #generics #where_clause { type Output = Self; @@ -375,6 +381,7 @@ impl Patch { } } + #[automatically_derived] impl #generics core::ops::Add for #name #generics #where_clause { type Output = Self; @@ -436,6 +443,7 @@ impl Patch { let op_impl = quote!(); let patch_impl = quote! { + #[automatically_derived] impl #generics struct_patch::traits::Patch< #name #generics > for #struct_name #generics #where_clause { fn apply(&mut self, patch: #name #generics) { #( diff --git a/derive/src/substrate.rs b/derive/src/substrate.rs index c546f2d..42efc9c 100644 --- a/derive/src/substrate.rs +++ b/derive/src/substrate.rs @@ -26,6 +26,7 @@ impl Substrate { let active_site = json::to_string(fields); Ok(quote! { + #[automatically_derived] impl struct_patch::traits::Substrate for #struct_name { fn expose_content() -> &'static str { #active_site @@ -34,7 +35,10 @@ impl Substrate { println!("cargo:rustc-env={}={}", stringify!(#struct_name), Self::expose_content()); } } + + #[automatically_derived] impl #struct_name { + #[allow(clippy::too_many_arguments)] /// Support `decouple` of Complex with private fields, a new function generated by Substrate macro pub fn __substrate_new( #( #field_idents: #field_tys, )* @@ -44,6 +48,7 @@ impl Substrate { } } + #[allow(clippy::too_many_arguments)] /// Support `bind` of Catalyst with private fields, an unpack function generated by Substrate macro pub fn __substrate_unpack( self diff --git a/lib/Cargo.toml b/lib/Cargo.toml index fa02bbb..cd696f9 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -12,7 +12,7 @@ readme.workspace = true rust-version.workspace = true [dependencies] -struct-patch-derive = { version = "=0.12.3", path = "../derive" } +struct-patch-derive = { version = "=0.12.4", path = "../derive" } [dev-dependencies] serde_json = "1.0" diff --git a/no-std-examples/Cargo.toml b/no-std-examples/Cargo.toml index ad5e1fb..6e8b683 100644 --- a/no-std-examples/Cargo.toml +++ b/no-std-examples/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "no-std-examples" authors = ["Antonio Yang "] -version = "0.12.3" +version = "0.12.4" edition = "2021" license = "MIT"