@@ -1065,9 +1065,9 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
1065
1065
// are checked for privacy (RFC 736). Rather than computing the set of
1066
1066
// unmentioned fields, just check them all.
1067
1067
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 ) ;
1071
1071
let ( use_ctxt, span) = match field {
1072
1072
Some ( field) => ( field. ident . span , field. span ) ,
1073
1073
None => ( base. span , base. span ) ,
@@ -1077,7 +1077,7 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
1077
1077
} else {
1078
1078
for field in fields {
1079
1079
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 ) ;
1081
1081
self . check_field ( use_ctxt, field. span , adt, & variant. fields [ index] , false ) ;
1082
1082
}
1083
1083
}
@@ -1093,7 +1093,7 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
1093
1093
let variant = adt. variant_of_res ( res) ;
1094
1094
for field in fields {
1095
1095
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 ) ;
1097
1097
self . check_field ( use_ctxt, field. span , adt, & variant. fields [ index] , false ) ;
1098
1098
}
1099
1099
}
0 commit comments