@@ -543,7 +543,7 @@ impl EmbargoVisitor<'tcx> {
543
543
module : LocalDefId ,
544
544
) {
545
545
let level = Some ( AccessLevel :: Reachable ) ;
546
- if let ty :: Visibility :: Public = vis {
546
+ if vis. is_public ( ) {
547
547
self . update ( def_id, level) ;
548
548
}
549
549
match def_kind {
@@ -580,7 +580,7 @@ impl EmbargoVisitor<'tcx> {
580
580
581
581
DefKind :: Struct | DefKind :: Union => {
582
582
// While structs and unions have type privacy, their fields do not.
583
- if let ty :: Visibility :: Public = vis {
583
+ if vis. is_public ( ) {
584
584
let item =
585
585
self . tcx . hir ( ) . expect_item ( self . tcx . hir ( ) . local_def_id_to_hir_id ( def_id) ) ;
586
586
if let hir:: ItemKind :: Struct ( ref struct_def, _)
@@ -933,7 +933,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
933
933
let def_id = self . tcx . hir ( ) . local_def_id ( id) ;
934
934
if let Some ( exports) = self . tcx . module_exports ( def_id) {
935
935
for export in exports. iter ( ) {
936
- if export. vis == ty :: Visibility :: Public {
936
+ if export. vis . is_public ( ) {
937
937
if let Some ( def_id) = export. res . opt_def_id ( ) {
938
938
if let Some ( def_id) = def_id. as_local ( ) {
939
939
self . update ( def_id, Some ( AccessLevel :: Exported ) ) ;
@@ -1918,8 +1918,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'tcx> {
1918
1918
/// 1. It's contained within a public type
1919
1919
/// 2. It comes from a private crate
1920
1920
fn leaks_private_dep ( & self , item_id : DefId ) -> bool {
1921
- let ret = self . required_visibility == ty:: Visibility :: Public
1922
- && self . tcx . is_private_dep ( item_id. krate ) ;
1921
+ let ret = self . required_visibility . is_public ( ) && self . tcx . is_private_dep ( item_id. krate ) ;
1923
1922
1924
1923
tracing:: debug!( "leaks_private_dep(item_id={:?})={}" , item_id, ret) ;
1925
1924
ret
0 commit comments