@@ -1065,9 +1065,9 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
10651065 // are checked for privacy (RFC 736). Rather than computing the set of
10661066 // unmentioned fields, just check them all.
10671067 for ( vf_index, variant_field) in variant. fields . iter ( ) . enumerate ( ) {
1068- let field = fields. iter ( ) . find ( |f| {
1069- self . tcx . field_index ( f . hir_id , self . typeck_results ( ) ) == vf_index
1070- } ) ;
1068+ let field = fields
1069+ . iter ( )
1070+ . find ( |f| self . typeck_results ( ) . field_index ( f . hir_id ) == vf_index ) ;
10711071 let ( use_ctxt, span) = match field {
10721072 Some ( field) => ( field. ident . span , field. span ) ,
10731073 None => ( base. span , base. span ) ,
@@ -1077,7 +1077,7 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
10771077 } else {
10781078 for field in fields {
10791079 let use_ctxt = field. ident . span ;
1080- let index = self . tcx . field_index ( field. hir_id , self . typeck_results ( ) ) ;
1080+ let index = self . typeck_results ( ) . field_index ( field. hir_id ) ;
10811081 self . check_field ( use_ctxt, field. span , adt, & variant. fields [ index] , false ) ;
10821082 }
10831083 }
@@ -1093,7 +1093,7 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
10931093 let variant = adt. variant_of_res ( res) ;
10941094 for field in fields {
10951095 let use_ctxt = field. ident . span ;
1096- let index = self . tcx . field_index ( field. hir_id , self . typeck_results ( ) ) ;
1096+ let index = self . typeck_results ( ) . field_index ( field. hir_id ) ;
10971097 self . check_field ( use_ctxt, field. span , adt, & variant. fields [ index] , false ) ;
10981098 }
10991099 }
0 commit comments