@@ -24,7 +24,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
24
24
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
25
25
let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
26
26
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 ) ;
28
28
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
29
29
if let Some ( attr) = attr {
30
30
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<'_>
44
44
45
45
pub ( super ) fn check_impl_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
46
46
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 ) ;
48
48
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
49
49
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
50
50
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
67
67
68
68
pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
69
69
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 ) ;
71
71
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
72
72
73
73
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
@@ -137,7 +137,7 @@ fn check_must_use_candidate<'tcx>(
137
137
|| mutates_static ( cx, body)
138
138
|| in_external_macro ( cx. sess ( ) , item_span)
139
139
|| returns_unit ( decl)
140
- || !cx. access_levels . is_exported ( item_id)
140
+ || !cx. effective_visibilities . is_exported ( item_id)
141
141
|| is_must_use_ty ( cx, return_ty ( cx, cx. tcx . hir ( ) . local_def_id_to_hir_id ( item_id) ) )
142
142
{
143
143
return ;
0 commit comments