@@ -208,7 +208,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
208208 match kind {
209209 hir:: intravisit:: FnKind :: Method (
210210 _,
211- & hir:: MethodSig {
211+ & hir:: FnSig {
212212 header : hir:: FnHeader { abi : Abi :: Rust , .. } ,
213213 ..
214214 } ,
@@ -228,20 +228,20 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
228228
229229 fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx hir:: Item ) {
230230 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 {
232232 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) ;
235235 return ;
236236 }
237237 if cx. access_levels . is_exported ( item. hir_id ) && !is_proc_macro ( & item. attrs ) {
238238 check_must_use_candidate (
239239 cx,
240- decl,
240+ & sig . decl ,
241241 cx. tcx . hir ( ) . body ( * body_id) ,
242242 item. span ,
243243 item. hir_id ,
244- item. span . with_hi ( decl. output . span ( ) . hi ( ) ) ,
244+ item. span . with_hi ( sig . decl . output . span ( ) . hi ( ) ) ,
245245 "this function could have a `#[must_use]` attribute" ,
246246 ) ;
247247 }
0 commit comments