Skip to content
Myr

Merge pull request #2856 from dtolnay/dename

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Produce a separate warning for every colliding name

authored by David Tolnay · committed by GitHub · parents 7f1e697, c59e876 · Browse files · 1 file+14 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−6 removed

  • other:+14 added−6 removed

1 file+14 added−6 removed

modified:serde_derive/src/de.rs+14 added-6 removed
2215 unmodified lines
2216 let str_mapping = deserialized_fields.iter().map(|field| {2217 let ident = &field.ident;2218 let aliases = field.aliases;2219 // `aliases` also contains a main name2220 quote!(#(#aliases)|* => _serde::__private::Ok(#this_value::#ident))2220 quote! {2221 #(2222 #aliases => _serde::__private::Ok(#this_value::#ident),2223 )*2224 }2225 });2226 let bytes_mapping = deserialized_fields.iter().map(|field| {2227 let ident = &field.ident;2228 // `aliases` also contains a main name2229 let aliases = field2230 .aliases2231 .iter()2232 .map(|alias| Literal::byte_string(alias.value.as_bytes()));2229 quote!(#(#aliases)|* => _serde::__private::Ok(#this_value::#ident))2233 quote! {2234 #(2235 #aliases => _serde::__private::Ok(#this_value::#ident),2236 )*2237 }2238 });22392240 let expecting = expecting.unwrap_or(if is_variant {2241 "variant identifier"
189 unmodified lines
2431 where2432 __E: _serde::de::Error,2433 {2434 match __value {2427 #(#str_mapping,)*2435 #(#str_mapping)*2436 _ => {2437 #value_as_borrowed_str_content2438 #fallthrough_borrowed_arm2439 }
4 unmodified lines
2444 where2445 __E: _serde::de::Error,2446 {2447 match __value {2440 #(#bytes_mapping,)*2448 #(#bytes_mapping)*2449 _ => {2450 #bytes_to_str2451 #value_as_borrowed_bytes_content2452 #fallthrough_borrowed_arm
16 unmodified lines
2469 where2470 __E: _serde::de::Error,2471 {2472 match __value {2465 #(#str_mapping,)*2473 #(#str_mapping)*2474 _ => {2475 #value_as_str_content2476 #fallthrough_arm2477 }
4 unmodified lines
2482 where2483 __E: _serde::de::Error,2484 {2485 match __value {2478 #(#bytes_mapping,)*2486 #(#bytes_mapping)*2487 _ => {2488 #bytes_to_str2489 #value_as_bytes_content2490 #fallthrough_arm
735 unmodified lines