@@ -21,7 +21,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
21
21
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
22
22
let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
23
23
if let hir:: ItemKind :: Fn ( ref sig, _generics, ref body_id) = item. kind {
24
- let is_public = cx. access_levels . is_exported ( item. def_id ) ;
24
+ let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
25
25
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
26
26
if let Some ( attr) = attr {
27
27
check_needless_must_use ( cx, sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
@@ -31,7 +31,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
31
31
sig. decl ,
32
32
cx. tcx . hir ( ) . body ( * body_id) ,
33
33
item. span ,
34
- item. def_id ,
34
+ item. def_id . def_id ,
35
35
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
36
36
"this function could have a `#[must_use]` attribute" ,
37
37
) ;
@@ -41,19 +41,19 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
41
41
42
42
pub ( super ) fn check_impl_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
43
43
if let hir:: ImplItemKind :: Fn ( ref sig, ref body_id) = item. kind {
44
- let is_public = cx. access_levels . is_exported ( item. def_id ) ;
44
+ let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
45
45
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
46
46
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
47
47
let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
48
48
if let Some ( attr) = attr {
49
49
check_needless_must_use ( cx, sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
50
- } else if is_public && !is_proc_macro ( cx. sess ( ) , attrs) && trait_ref_of_method ( cx, item. def_id ) . is_none ( ) {
50
+ } else if is_public && !is_proc_macro ( cx. sess ( ) , attrs) && trait_ref_of_method ( cx, item. def_id . def_id ) . is_none ( ) {
51
51
check_must_use_candidate (
52
52
cx,
53
53
sig. decl ,
54
54
cx. tcx . hir ( ) . body ( * body_id) ,
55
55
item. span ,
56
- item. def_id ,
56
+ item. def_id . def_id ,
57
57
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
58
58
"this method could have a `#[must_use]` attribute" ,
59
59
) ;
@@ -63,7 +63,7 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
63
63
64
64
pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
65
65
if let hir:: TraitItemKind :: Fn ( ref sig, ref eid) = item. kind {
66
- let is_public = cx. access_levels . is_exported ( item. def_id ) ;
66
+ let is_public = cx. access_levels . is_exported ( item. def_id . def_id ) ;
67
67
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
68
68
69
69
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
@@ -78,7 +78,7 @@ pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Tr
78
78
sig. decl ,
79
79
body,
80
80
item. span ,
81
- item. def_id ,
81
+ item. def_id . def_id ,
82
82
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
83
83
"this method could have a `#[must_use]` attribute" ,
84
84
) ;
@@ -171,7 +171,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
171
171
return false ; // ignore `_` patterns
172
172
}
173
173
if cx. tcx . has_typeck_results ( pat. hir_id . owner . to_def_id ( ) ) {
174
- is_mutable_ty ( cx, cx. tcx . typeck ( pat. hir_id . owner ) . pat_ty ( pat) , pat. span , tys)
174
+ is_mutable_ty ( cx, cx. tcx . typeck ( pat. hir_id . owner . def_id ) . pat_ty ( pat) , pat. span , tys)
175
175
} else {
176
176
false
177
177
}
@@ -218,7 +218,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
218
218
if self . cx . tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
219
219
&& is_mutable_ty (
220
220
self . cx ,
221
- self . cx . tcx . typeck ( arg. hir_id . owner ) . expr_ty ( arg) ,
221
+ self . cx . tcx . typeck ( arg. hir_id . owner . def_id ) . expr_ty ( arg) ,
222
222
arg. span ,
223
223
& mut tys,
224
224
)
@@ -236,7 +236,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
236
236
if self . cx . tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
237
237
&& is_mutable_ty (
238
238
self . cx ,
239
- self . cx . tcx . typeck ( arg. hir_id . owner ) . expr_ty ( arg) ,
239
+ self . cx . tcx . typeck ( arg. hir_id . owner . def_id ) . expr_ty ( arg) ,
240
240
arg. span ,
241
241
& mut tys,
242
242
)
0 commit comments