mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 10:11:01 +00:00
Add partially-working where bounds for associated types
This commit is contained in:
@@ -124,7 +124,9 @@ impl Parameters {
|
||||
fn build_generics(cont: &Container, borrowed: &BorrowedLifetimes) -> syn::Generics {
|
||||
let generics = bound::without_defaults(cont.generics);
|
||||
|
||||
let generics = bound::with_where_predicates_from_fields(cont, &generics, attr::Field::de_bound);
|
||||
let delife = borrowed.de_lifetime();
|
||||
let de_bound = parse_quote!(_serde::Deserialize<#delife>);
|
||||
let generics = bound::with_where_predicates_from_fields(cont, &generics, &de_bound, attr::Field::de_bound, attr::Field::deserialize_with);
|
||||
|
||||
match cont.attrs.de_bound() {
|
||||
Some(predicates) => bound::with_where_predicates(&generics, predicates),
|
||||
@@ -136,12 +138,11 @@ fn build_generics(cont: &Container, borrowed: &BorrowedLifetimes) -> syn::Generi
|
||||
attr::Default::None | attr::Default::Path(_) => generics,
|
||||
};
|
||||
|
||||
let delife = borrowed.de_lifetime();
|
||||
let generics = bound::with_bound(
|
||||
cont,
|
||||
&generics,
|
||||
needs_deserialize_bound,
|
||||
&parse_quote!(_serde::Deserialize<#delife>),
|
||||
&de_bound,
|
||||
);
|
||||
|
||||
bound::with_bound(
|
||||
|
||||
Reference in New Issue
Block a user