@@ -21,7 +21,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
2121 let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
2222 let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
2323 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 ) ;
2525 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
2626 if let Some ( attr) = attr {
2727 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<'_>
3131 sig. decl ,
3232 cx. tcx . hir ( ) . body ( * body_id) ,
3333 item. span ,
34- item. def_id ,
34+ item. def_id . def_id ,
3535 item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
3636 "this function could have a `#[must_use]` attribute" ,
3737 ) ;
@@ -41,19 +41,19 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
4141
4242pub ( super ) fn check_impl_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
4343 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 ) ;
4545 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
4646 let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
4747 let attr = cx. tcx . get_attr ( item. def_id . to_def_id ( ) , sym:: must_use) ;
4848 if let Some ( attr) = attr {
4949 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 ( ) {
5151 check_must_use_candidate (
5252 cx,
5353 sig. decl ,
5454 cx. tcx . hir ( ) . body ( * body_id) ,
5555 item. span ,
56- item. def_id ,
56+ item. def_id . def_id ,
5757 item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
5858 "this method could have a `#[must_use]` attribute" ,
5959 ) ;
@@ -63,7 +63,7 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
6363
6464pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
6565 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 ) ;
6767 let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
6868
6969 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
7878 sig. decl ,
7979 body,
8080 item. span ,
81- item. def_id ,
81+ item. def_id . def_id ,
8282 item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
8383 "this method could have a `#[must_use]` attribute" ,
8484 ) ;
@@ -171,7 +171,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
171171 return false ; // ignore `_` patterns
172172 }
173173 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)
175175 } else {
176176 false
177177 }
@@ -218,7 +218,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
218218 if self . cx . tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
219219 && is_mutable_ty (
220220 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) ,
222222 arg. span ,
223223 & mut tys,
224224 )
@@ -236,7 +236,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
236236 if self . cx . tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
237237 && is_mutable_ty (
238238 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) ,
240240 arg. span ,
241241 & mut tys,
242242 )
0 commit comments