mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Opt into field bounds when deriving ToCss, instead of opting out
This commit is contained in:
parent
8133f788cf
commit
859002a81f
8 changed files with 89 additions and 67 deletions
|
@ -40,11 +40,14 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
let attrs = cg::parse_field_attrs::<ComputedValueAttrs>(&binding.ast());
|
||||
if attrs.clone {
|
||||
if cg::is_parameterized(&binding.ast().ty, &where_clause.params, None) {
|
||||
where_clause.add_predicate(cg::where_predicate(
|
||||
binding.ast().ty.clone(),
|
||||
&parse_quote!(std::clone::Clone),
|
||||
None,
|
||||
));
|
||||
cg::add_predicate(
|
||||
&mut where_clause.inner,
|
||||
cg::where_predicate(
|
||||
binding.ast().ty.clone(),
|
||||
&parse_quote!(std::clone::Clone),
|
||||
None,
|
||||
),
|
||||
);
|
||||
}
|
||||
quote! { ::std::clone::Clone::clone(#binding) }
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue