@@ -24,7 +24,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
2424 let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
2525 let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
2626 if let hir:: ItemKind :: Fn ( ref sig, _generics, ref body_id) = item. kind {
27- let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
27+ let is_public = cx. effective_visibilities . is_exported ( item. def_id . def_id ) ;
2828 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
2929 if let Some ( attr) = attr {
3030 check_needless_must_use ( cx, sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
@@ -44,7 +44,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
4444
4545pub ( super ) fn check_impl_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
4646 if let hir:: ImplItemKind :: Fn ( ref sig, ref body_id) = item. kind {
47- let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
47+ let is_public = cx. effective_visibilities . is_exported ( item. def_id . def_id ) ;
4848 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
4949 let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
5050 let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
@@ -67,7 +67,7 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
6767
6868pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
6969 if let hir:: TraitItemKind :: Fn ( ref sig, ref eid) = item. kind {
70- let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
70+ let is_public = cx. effective_visibilities . is_exported ( item. def_id . def_id ) ;
7171 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
7272
7373 let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
@@ -137,7 +137,7 @@ fn check_must_use_candidate<'tcx>(
137137 || mutates_static ( cx, body)
138138 || in_external_macro ( cx. sess ( ) , item_span)
139139 || returns_unit ( decl)
140- || !cx. access_levels . is_exported ( item_id)
140+ || !cx. effective_visibilities . is_exported ( item_id)
141141 || is_must_use_ty ( cx, return_ty ( cx, cx. tcx . hir ( ) . local_def_id_to_hir_id ( item_id) ) )
142142 {
143143 return ;
0 commit comments