@@ -22,7 +22,7 @@ use super::{DOUBLE_MUST_USE, MUST_USE_CANDIDATE, MUST_USE_UNIT};
22
22
23
23
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
- let attr = cx. tcx . get_attr ( item. owner_id . to_def_id ( ) , sym:: must_use) ;
25
+ let attr = cx. tcx . get_attr ( item. owner_id , sym:: must_use) ;
26
26
if let hir:: ItemKind :: Fn ( ref sig, _generics, ref body_id) = item. kind {
27
27
let is_public = cx. effective_visibilities . is_exported ( item. owner_id . def_id ) ;
28
28
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
@@ -47,7 +47,7 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
47
47
let is_public = cx. effective_visibilities . is_exported ( item. owner_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
- let attr = cx. tcx . get_attr ( item. owner_id . to_def_id ( ) , sym:: must_use) ;
50
+ let attr = cx. tcx . get_attr ( item. owner_id , sym:: must_use) ;
51
51
if let Some ( attr) = attr {
52
52
check_needless_must_use ( cx, sig. decl , item. owner_id , item. span , fn_header_span, attr) ;
53
53
} else if is_public
@@ -73,7 +73,7 @@ pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Tr
73
73
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
74
74
75
75
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
76
- let attr = cx. tcx . get_attr ( item. owner_id . to_def_id ( ) , sym:: must_use) ;
76
+ let attr = cx. tcx . get_attr ( item. owner_id , sym:: must_use) ;
77
77
if let Some ( attr) = attr {
78
78
check_needless_must_use ( cx, sig. decl , item. owner_id , item. span , fn_header_span, attr) ;
79
79
} else if let hir:: TraitFn :: Provided ( eid) = * eid {
0 commit comments