Skip to content
Open
Changes from all commits
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
Do not use generic param defaults in impls
  • Loading branch information
rmartinho committed Aug 21, 2025
commit 111e24883e46a9cd3666690190eac3bb47bb46b7
5 changes: 2 additions & 3 deletions implicit-clone-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ pub fn derive_implicit_clone(item: proc_macro::TokenStream) -> proc_macro::Token
ident,
colon_token: _,
bounds,
eq_token,
default,
..
}) => {
let bounds = bounds
.iter()
.map(|bound| quote! { #bound })
.chain(std::iter::once(quote! { ::implicit_clone::ImplicitClone }))
.collect::<Vec<_>>();
quote! {
#(#attrs)* #ident: #(#bounds)+* #eq_token #default
#(#attrs)* #ident: #(#bounds)+*
}
}
_ => quote! { #param },
Expand Down