@@ -283,13 +283,13 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
283
283
fn check_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx hir:: Item < ' _ > ) {
284
284
let attr = must_use_attr ( & item. attrs ) ;
285
285
if let hir:: ItemKind :: Fn ( ref sig, ref _generics, ref body_id) = item. kind {
286
- let is_public = cx. access_levels . is_exported ( item. hir_id ) ;
286
+ let is_public = cx. access_levels . is_exported ( item. hir_id ( ) ) ;
287
287
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
288
288
if is_public {
289
289
check_result_unit_err ( cx, & sig. decl , item. span , fn_header_span) ;
290
290
}
291
291
if let Some ( attr) = attr {
292
- check_needless_must_use ( cx, & sig. decl , item. hir_id , item. span , fn_header_span, attr) ;
292
+ check_needless_must_use ( cx, & sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
293
293
return ;
294
294
}
295
295
if is_public && !is_proc_macro ( cx. sess ( ) , & item. attrs ) && attr_by_name ( & item. attrs , "no_mangle" ) . is_none ( ) {
@@ -298,7 +298,7 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
298
298
& sig. decl ,
299
299
cx. tcx . hir ( ) . body ( * body_id) ,
300
300
item. span ,
301
- item. hir_id ,
301
+ item. hir_id ( ) ,
302
302
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
303
303
"this function could have a `#[must_use]` attribute" ,
304
304
) ;
@@ -308,24 +308,24 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
308
308
309
309
fn check_impl_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
310
310
if let hir:: ImplItemKind :: Fn ( ref sig, ref body_id) = item. kind {
311
- let is_public = cx. access_levels . is_exported ( item. hir_id ) ;
311
+ let is_public = cx. access_levels . is_exported ( item. hir_id ( ) ) ;
312
312
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
313
- if is_public && trait_ref_of_method ( cx, item. hir_id ) . is_none ( ) {
313
+ if is_public && trait_ref_of_method ( cx, item. hir_id ( ) ) . is_none ( ) {
314
314
check_result_unit_err ( cx, & sig. decl , item. span , fn_header_span) ;
315
315
}
316
316
let attr = must_use_attr ( & item. attrs ) ;
317
317
if let Some ( attr) = attr {
318
- check_needless_must_use ( cx, & sig. decl , item. hir_id , item. span , fn_header_span, attr) ;
318
+ check_needless_must_use ( cx, & sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
319
319
} else if is_public
320
320
&& !is_proc_macro ( cx. sess ( ) , & item. attrs )
321
- && trait_ref_of_method ( cx, item. hir_id ) . is_none ( )
321
+ && trait_ref_of_method ( cx, item. hir_id ( ) ) . is_none ( )
322
322
{
323
323
check_must_use_candidate (
324
324
cx,
325
325
& sig. decl ,
326
326
cx. tcx . hir ( ) . body ( * body_id) ,
327
327
item. span ,
328
- item. hir_id ,
328
+ item. hir_id ( ) ,
329
329
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
330
330
"this method could have a `#[must_use]` attribute" ,
331
331
) ;
@@ -339,27 +339,27 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
339
339
if sig. header . abi == Abi :: Rust {
340
340
self . check_arg_number ( cx, & sig. decl , item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ) ;
341
341
}
342
- let is_public = cx. access_levels . is_exported ( item. hir_id ) ;
342
+ let is_public = cx. access_levels . is_exported ( item. hir_id ( ) ) ;
343
343
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
344
344
if is_public {
345
345
check_result_unit_err ( cx, & sig. decl , item. span , fn_header_span) ;
346
346
}
347
347
348
348
let attr = must_use_attr ( & item. attrs ) ;
349
349
if let Some ( attr) = attr {
350
- check_needless_must_use ( cx, & sig. decl , item. hir_id , item. span , fn_header_span, attr) ;
350
+ check_needless_must_use ( cx, & sig. decl , item. hir_id ( ) , item. span , fn_header_span, attr) ;
351
351
}
352
352
if let hir:: TraitFn :: Provided ( eid) = * eid {
353
353
let body = cx. tcx . hir ( ) . body ( eid) ;
354
- Self :: check_raw_ptr ( cx, sig. header . unsafety , & sig. decl , body, item. hir_id ) ;
354
+ Self :: check_raw_ptr ( cx, sig. header . unsafety , & sig. decl , body, item. hir_id ( ) ) ;
355
355
356
356
if attr. is_none ( ) && is_public && !is_proc_macro ( cx. sess ( ) , & item. attrs ) {
357
357
check_must_use_candidate (
358
358
cx,
359
359
& sig. decl ,
360
360
body,
361
361
item. span ,
362
- item. hir_id ,
362
+ item. hir_id ( ) ,
363
363
item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ,
364
364
"this method could have a `#[must_use]` attribute" ,
365
365
) ;
0 commit comments