Produce a separate warning for every colliding name
This commit is contained in:
parent
7f1e697c0d
commit
c59e876bb3
@ -2217,7 +2217,11 @@ fn deserialize_identifier(
|
||||
let ident = &field.ident;
|
||||
let aliases = field.aliases;
|
||||
// `aliases` also contains a main name
|
||||
quote!(#(#aliases)|* => _serde::__private::Ok(#this_value::#ident))
|
||||
quote! {
|
||||
#(
|
||||
#aliases => _serde::__private::Ok(#this_value::#ident),
|
||||
)*
|
||||
}
|
||||
});
|
||||
let bytes_mapping = deserialized_fields.iter().map(|field| {
|
||||
let ident = &field.ident;
|
||||
@ -2226,7 +2230,11 @@ fn deserialize_identifier(
|
||||
.aliases
|
||||
.iter()
|
||||
.map(|alias| Literal::byte_string(alias.value.as_bytes()));
|
||||
quote!(#(#aliases)|* => _serde::__private::Ok(#this_value::#ident))
|
||||
quote! {
|
||||
#(
|
||||
#aliases => _serde::__private::Ok(#this_value::#ident),
|
||||
)*
|
||||
}
|
||||
});
|
||||
|
||||
let expecting = expecting.unwrap_or(if is_variant {
|
||||
@ -2424,7 +2432,7 @@ fn deserialize_identifier(
|
||||
__E: _serde::de::Error,
|
||||
{
|
||||
match __value {
|
||||
#(#str_mapping,)*
|
||||
#(#str_mapping)*
|
||||
_ => {
|
||||
#value_as_borrowed_str_content
|
||||
#fallthrough_borrowed_arm
|
||||
@ -2437,7 +2445,7 @@ fn deserialize_identifier(
|
||||
__E: _serde::de::Error,
|
||||
{
|
||||
match __value {
|
||||
#(#bytes_mapping,)*
|
||||
#(#bytes_mapping)*
|
||||
_ => {
|
||||
#bytes_to_str
|
||||
#value_as_borrowed_bytes_content
|
||||
@ -2462,7 +2470,7 @@ fn deserialize_identifier(
|
||||
__E: _serde::de::Error,
|
||||
{
|
||||
match __value {
|
||||
#(#str_mapping,)*
|
||||
#(#str_mapping)*
|
||||
_ => {
|
||||
#value_as_str_content
|
||||
#fallthrough_arm
|
||||
@ -2475,7 +2483,7 @@ fn deserialize_identifier(
|
||||
__E: _serde::de::Error,
|
||||
{
|
||||
match __value {
|
||||
#(#bytes_mapping,)*
|
||||
#(#bytes_mapping)*
|
||||
_ => {
|
||||
#bytes_to_str
|
||||
#value_as_bytes_content
|
||||
|
Loading…
x
Reference in New Issue
Block a user