Skip to content
Snippets Groups Projects
Unverified Commit 640e385a authored by benluelo's avatar benluelo Committed by GitHub
Browse files

feat(frame-support-procedural): add `automaticaly_derived` attr to `NoBound` derives (#2197)

fixes #2196
parent 2e2a75ff
No related merge requests found
Pipeline #411043 passed with stages
in 44 minutes and 48 seconds
......@@ -98,6 +98,7 @@ pub fn derive_clone_no_bound(input: proc_macro::TokenStream) -> proc_macro::Toke
quote::quote!(
const _: () = {
#[automatically_derived]
impl #impl_generics ::core::clone::Clone for #name #ty_generics #where_clause {
fn clone(&self) -> Self {
#impl_
......
......@@ -112,6 +112,7 @@ pub fn derive_debug_no_bound(input: proc_macro::TokenStream) -> proc_macro::Toke
quote::quote!(
const _: () = {
#[automatically_derived]
impl #impl_generics ::core::fmt::Debug for #input_ident #ty_generics #where_clause {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
#impl_
......
......@@ -149,6 +149,7 @@ pub fn derive_default_no_bound(input: proc_macro::TokenStream) -> proc_macro::To
quote!(
const _: () = {
#[automatically_derived]
impl #impl_generics ::core::default::Default for #name #ty_generics #where_clause {
fn default() -> Self {
#impl_
......
......@@ -128,6 +128,7 @@ pub fn derive_partial_eq_no_bound(input: proc_macro::TokenStream) -> proc_macro:
quote::quote!(
const _: () = {
#[automatically_derived]
impl #impl_generics ::core::cmp::PartialEq for #name #ty_generics #where_clause {
fn eq(&self, other: &Self) -> bool {
#impl_
......
......@@ -136,6 +136,7 @@ struct StructNoGenerics {
field2: u64,
}
#[allow(dead_code)]
#[derive(DebugNoBound, CloneNoBound, EqNoBound, PartialEqNoBound, DefaultNoBound)]
enum EnumNoGenerics {
#[default]
......@@ -162,6 +163,7 @@ enum Enum<T: Config, U, V> {
}
// enum that will have a named default.
#[allow(dead_code)]
#[derive(DebugNoBound, CloneNoBound, EqNoBound, PartialEqNoBound, DefaultNoBound)]
enum Enum2<T: Config> {
#[default]
......@@ -175,6 +177,7 @@ enum Enum2<T: Config> {
VariantUnit2,
}
#[allow(dead_code)]
// enum that will have a unit default.
#[derive(DebugNoBound, CloneNoBound, EqNoBound, PartialEqNoBound, DefaultNoBound)]
enum Enum3<T: Config> {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment