Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
kianenigma authored May 13, 2023
commit 16c91e10eec2323abfa53b8d88cc5f04f1017b8e
12 changes: 4 additions & 8 deletions frame/support/procedural/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,9 @@ pub fn derive_debug_no_bound(input: TokenStream) -> TokenStream {
/// This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.
#[proc_macro_derive(RuntimeDebugNoBound)]
pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream {
#[cfg(not(any(feature = "std", feature = "try-runtime")))]
{
if cfg!(any(feature = "std", feature = "try-runtime")) {
debug_no_bound::derive_debug_no_bound(input)
} else {
let input: syn::DeriveInput = match syn::parse(input) {
Ok(input) => input,
Err(e) => return e.to_compile_error().into(),
Expand All @@ -666,18 +667,13 @@ pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream {
const _: () = {
impl #impl_generics core::fmt::Debug for #name #ty_generics #where_clause {
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
fmt.write_str("<stripped>")
fmt.write_str("<wasm:stripped>")
}
}
};
)
.into()
}

#[cfg(any(feature = "std", feature = "try-runtime"))]
{
debug_no_bound::derive_debug_no_bound(input)
}
}

/// Derive [`PartialEq`] but do not bound any generic. Docs are at
Expand Down