File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
serde_derive/src/internals
test_suite/tests/ui/borrow Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1114,13 +1114,13 @@ impl Field {
11141114 . and_then ( |variant| variant. borrow . as_ref ( ) )
11151115 . map ( |borrow| Meta ( borrow. clone ( ) ) ) ;
11161116
1117- for meta_item in field
1118- . attrs
1119- . iter ( )
1120- . flat_map ( |attr| get_serde_meta_items ( cx , attr ) )
1121- . flatten ( )
1122- . chain ( variant_borrow )
1123- {
1117+ for meta_item in variant_borrow . into_iter ( ) . chain (
1118+ field
1119+ . attrs
1120+ . iter ( )
1121+ . flat_map ( |attr| get_serde_meta_items ( cx , attr ) )
1122+ . flatten ( ) ,
1123+ ) {
11241124 match & meta_item {
11251125 // Parse `#[serde(rename = "foo")]`
11261126 Meta ( NameValue ( m) ) if m. path == RENAME => {
Original file line number Diff line number Diff line change 11error: duplicate serde attribute `borrow`
2- --> tests/ui/borrow/duplicate_variant.rs:8:13
2+ --> tests/ui/borrow/duplicate_variant.rs:9:15
33 |
4- 8 | #[serde(borrow)]
5- | ^^^^^^
4+ 9 | S( #[serde(borrow)] Str<'a>),
5+ | ^^^^^^
You can’t perform that action at this time.
0 commit comments