@@ -599,7 +599,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
599
599
DefKind :: Struct | DefKind :: Union => {
600
600
// While structs and unions have type privacy, their fields do not.
601
601
let struct_def = self . tcx . adt_def ( def_id) ;
602
- for field in struct_def. non_enum_variant ( ) . fields . iter ( ) {
602
+ for field in & struct_def. non_enum_variant ( ) . fields {
603
603
let def_id = field. did . expect_local ( ) ;
604
604
let field_vis = self . tcx . local_visibility ( def_id) ;
605
605
if field_vis. is_accessible_from ( module, self . tcx ) {
@@ -743,7 +743,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
743
743
self . update ( ctor_def_id. expect_local ( ) , variant_ev, Level :: Reachable ) ;
744
744
}
745
745
746
- for field in variant. fields . iter ( ) {
746
+ for field in & variant. fields {
747
747
let field = field. did . expect_local ( ) ;
748
748
self . update ( field, variant_ev, Level :: Reachable ) ;
749
749
self . reach ( field, variant_ev) . ty ( ) ;
@@ -763,7 +763,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
763
763
let def = self . tcx . adt_def ( owner_id) . non_enum_variant ( ) ;
764
764
if let Some ( item_ev) = item_ev {
765
765
self . reach ( owner_id. def_id , item_ev) . generics ( ) . predicates ( ) ;
766
- for field in def. fields . iter ( ) {
766
+ for field in & def. fields {
767
767
let field = field. did . expect_local ( ) ;
768
768
self . update ( field, item_ev, Level :: Reachable ) ;
769
769
if let Some ( field_ev) = self . get ( field) {
@@ -890,7 +890,7 @@ impl<'a, 'tcx> TestReachabilityVisitor<'a, 'tcx> {
890
890
if let Some ( ctor_def_id) = variant. ctor_def_id ( ) {
891
891
self . effective_visibility_diagnostic ( ctor_def_id. expect_local ( ) ) ;
892
892
}
893
- for field in variant. fields . iter ( ) {
893
+ for field in & variant. fields {
894
894
self . effective_visibility_diagnostic ( field. did . expect_local ( ) ) ;
895
895
}
896
896
}
@@ -900,7 +900,7 @@ impl<'a, 'tcx> TestReachabilityVisitor<'a, 'tcx> {
900
900
if let Some ( ctor_def_id) = def. ctor_def_id ( ) {
901
901
self . effective_visibility_diagnostic ( ctor_def_id. expect_local ( ) ) ;
902
902
}
903
- for field in def. fields . iter ( ) {
903
+ for field in & def. fields {
904
904
self . effective_visibility_diagnostic ( field. did . expect_local ( ) ) ;
905
905
}
906
906
}
0 commit comments