File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1063,11 +1063,11 @@ impl FieldKey {
10631063 Member :: Unnamed ( index) => Self :: Unnamed ( index. index as usize ) ,
10641064 }
10651065 }
1066- fn from_field ( field : & Field ) -> Self {
1066+ fn from_field ( index : usize , field : & Field ) -> Self {
10671067 if let Some ( ident) = & field. ident {
10681068 Self :: from_ident ( ident)
10691069 } else {
1070- Self :: Unnamed ( 0 )
1070+ Self :: Unnamed ( index )
10711071 }
10721072 }
10731073
Original file line number Diff line number Diff line change @@ -475,15 +475,15 @@ impl<'a> ParserBuilder<'a> {
475475 if !bounds. can_extend {
476476 return Ok ( ( ) ) ;
477477 }
478- for field in self . fields . values ( ) {
478+ for ( index , field) in self . fields . values ( ) . enumerate ( ) {
479479 let mut bounds = bounds. child ( field. hattrs . bound_from_str_resolved ( ) ) ;
480480 if bounds. can_extend && field. capture . is_some ( ) && field. hattrs . with . is_none ( ) {
481481 let mut ty = & field. source . ty ;
482482 if field. hattrs . opt . value ( ) {
483483 if let Some ( opt_ty) = get_option_element ( ty) {
484484 ty = opt_ty;
485485 } else {
486- let key = FieldKey :: from_field ( field. source ) ;
486+ let key = FieldKey :: from_field ( index , field. source ) ;
487487 bail ! ( ty. span( ) , "field `{key}` is not a option type." ) ;
488488 }
489489 }
You can’t perform that action at this time.
0 commit comments