mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Opt into field bounds for #[derive(ToComputedValue)]
This commit is contained in:
parent
2efd06c12d
commit
4d0bf2ddf9
5 changed files with 55 additions and 46 deletions
|
@ -111,7 +111,7 @@ where
|
|||
})
|
||||
}
|
||||
|
||||
fn fmap_output_type(
|
||||
pub fn fmap_output_type(
|
||||
ty: Type,
|
||||
trait_path: &Path,
|
||||
trait_output: Ident,
|
||||
|
@ -119,17 +119,6 @@ fn fmap_output_type(
|
|||
parse_quote!(<#ty as ::#trait_path>::#trait_output)
|
||||
}
|
||||
|
||||
pub fn fmap_trait_parts<'input, 'path>(
|
||||
input: &'input DeriveInput,
|
||||
trait_path: &'path Path,
|
||||
trait_output: Ident,
|
||||
) -> (ImplGenerics<'input>, TypeGenerics<'input>, WhereClause<'input, 'path>, Path) {
|
||||
let (impl_generics, ty_generics, mut where_clause) = trait_parts(input, trait_path);
|
||||
where_clause.trait_output = Some(trait_output);
|
||||
let output_ty = fmap_trait_output(input, trait_path, trait_output);
|
||||
(impl_generics, ty_generics, where_clause, output_ty)
|
||||
}
|
||||
|
||||
pub fn fmap_trait_output(
|
||||
input: &DeriveInput,
|
||||
trait_path: &Path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue