-
Notifications
You must be signed in to change notification settings - Fork 2.6k
sp-api: Make the generated code act based on std
in sp-api
#14267
Conversation
Instead of letting the macro generate code that checks if the `std` feature is enabled, it will now generate code that checks if the `std` feature is enabled for the `sp-api` crate. The old implementation basically required that the crate in which the macro was used, had a `std` feature. Now we don't have this requirement anymore and act accordingly the feature in `sp-api` directly.
bot rebase |
Rebased |
@@ -539,8 +539,6 @@ impl<'a> Fold for ToClientSideDecl<'a> { | |||
input.supertraits.push(parse_quote!( #crate_::Core<#block_ident> )); | |||
} | |||
|
|||
// The client side trait is only required when compiling with the feature `std` or `test`. | |||
input.attrs.push(parse_quote!( #[cfg(any(feature = "std", test))] )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal of test is intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was basically done to ensure that someone may not declares the std
feature for their crate. However, this was not really working as otherwise this pr would not have been required.
So this doesn't solve #14145 yet it seems? |
No. This wasn't meant to solve this. This needs to be solved as the FRAME macros which also suffer the same problem, as I already told you. The idea of also supporting the |
…ytech#14267) * sp-api: Make the generated code act based on `std` in `sp-api` Instead of letting the macro generate code that checks if the `std` feature is enabled, it will now generate code that checks if the `std` feature is enabled for the `sp-api` crate. The old implementation basically required that the crate in which the macro was used, had a `std` feature. Now we don't have this requirement anymore and act accordingly the feature in `sp-api` directly. * Missing feature! --------- Co-authored-by: parity-processbot <>
Instead of letting the macro generate code that checks if the
std
feature is enabled, it will now generate code that checks if thestd
feature is enabled for thesp-api
crate. The old implementation basically required that the crate in which the macro was used, had astd
feature. Now we don't have this requirement anymore and act accordingly the feature insp-api
directly.