@@ -208,7 +208,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
208
208
match kind {
209
209
hir:: intravisit:: FnKind :: Method (
210
210
_,
211
- & hir:: MethodSig {
211
+ & hir:: FnSig {
212
212
header : hir:: FnHeader { abi : Abi :: Rust , .. } ,
213
213
..
214
214
} ,
@@ -228,20 +228,20 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
228
228
229
229
fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx hir:: Item ) {
230
230
let attr = must_use_attr ( & item. attrs ) ;
231
- if let hir:: ItemKind :: Fn ( ref decl , ref _header , ref _generics, ref body_id) = item. kind {
231
+ if let hir:: ItemKind :: Fn ( ref sig , ref _generics, ref body_id) = item. kind {
232
232
if let Some ( attr) = attr {
233
- let fn_header_span = item. span . with_hi ( decl. output . span ( ) . hi ( ) ) ;
234
- check_needless_must_use ( cx, decl, item. hir_id , item. span , fn_header_span, attr) ;
233
+ let fn_header_span = item. span . with_hi ( sig . decl . output . span ( ) . hi ( ) ) ;
234
+ check_needless_must_use ( cx, & sig . decl , item. hir_id , item. span , fn_header_span, attr) ;
235
235
return ;
236
236
}
237
237
if cx. access_levels . is_exported ( item. hir_id ) && !is_proc_macro ( & item. attrs ) {
238
238
check_must_use_candidate (
239
239
cx,
240
- decl,
240
+ & sig . decl ,
241
241
cx. tcx . hir ( ) . body ( * body_id) ,
242
242
item. span ,
243
243
item. hir_id ,
244
- item. span . with_hi ( decl. output . span ( ) . hi ( ) ) ,
244
+ item. span . with_hi ( sig . decl . output . span ( ) . hi ( ) ) ,
245
245
"this function could have a `#[must_use]` attribute" ,
246
246
) ;
247
247
}
0 commit comments