@@ -592,7 +592,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
592
592
Option :: < AccessLevel > :: of_impl ( item. hir_id , self . tcx , & self . access_levels )
593
593
}
594
594
// Foreign modules inherit level from parents.
595
- hir:: ItemKind :: ForeignMod ( .. ) => self . prev_level ,
595
+ hir:: ItemKind :: ForeignMod { .. } => self . prev_level ,
596
596
// Other `pub` items inherit levels from parents.
597
597
hir:: ItemKind :: Const ( ..)
598
598
| hir:: ItemKind :: Enum ( ..)
@@ -654,8 +654,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
654
654
}
655
655
}
656
656
}
657
- hir:: ItemKind :: ForeignMod ( ref foreign_mod ) => {
658
- for foreign_item in foreign_mod . items {
657
+ hir:: ItemKind :: ForeignMod { items , .. } => {
658
+ for foreign_item in items {
659
659
if foreign_item. vis . node . is_pub ( ) {
660
660
self . update ( foreign_item. id . hir_id , item_level) ;
661
661
}
@@ -770,8 +770,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
770
770
}
771
771
}
772
772
// Visit everything, but foreign items have their own levels.
773
- hir:: ItemKind :: ForeignMod ( ref foreign_mod ) => {
774
- for foreign_item in foreign_mod . items {
773
+ hir:: ItemKind :: ForeignMod { items , .. } => {
774
+ for foreign_item in items {
775
775
let foreign_item_level = self . get ( foreign_item. id . hir_id ) ;
776
776
if foreign_item_level. is_some ( ) {
777
777
self . reach ( foreign_item. id . hir_id , foreign_item_level)
@@ -1430,7 +1430,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
1430
1430
1431
1431
// An `extern {}` doesn't introduce a new privacy
1432
1432
// namespace (the contents have their own privacies).
1433
- hir:: ItemKind :: ForeignMod ( _ ) => { }
1433
+ hir:: ItemKind :: ForeignMod { .. } => { }
1434
1434
1435
1435
hir:: ItemKind :: Trait ( .., ref bounds, _) => {
1436
1436
if !self . trait_is_public ( item. hir_id ) {
@@ -1948,8 +1948,8 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>
1948
1948
}
1949
1949
}
1950
1950
// Subitems of foreign modules have their own publicity.
1951
- hir:: ItemKind :: ForeignMod ( ref foreign_mod ) => {
1952
- for foreign_item in foreign_mod . items {
1951
+ hir:: ItemKind :: ForeignMod { items , .. } => {
1952
+ for foreign_item in items {
1953
1953
let vis = tcx. visibility ( tcx. hir ( ) . local_def_id ( foreign_item. id . hir_id ) ) ;
1954
1954
self . check ( foreign_item. id . hir_id , vis) . generics ( ) . predicates ( ) . ty ( ) ;
1955
1955
}
0 commit comments