@@ -258,7 +258,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
258
258
fn check_fn ( & mut self , cx : & LateContext < ' _ > , _: FnKind < ' _ > , decl : & FnDecl < ' _ > , _: & Body < ' _ > , _: Span , id : HirId ) {
259
259
// Skip trait implementations; see issue #605.
260
260
if let Some ( hir:: Node :: Item ( item) ) = cx. tcx . hir ( ) . find ( cx. tcx . hir ( ) . get_parent_item ( id) ) {
261
- if let ItemKind :: Impl { of_trait : Some ( _) , .. } = item. kind {
261
+ if let ItemKind :: Impl ( hir :: Impl { of_trait : Some ( _) , .. } ) = item. kind {
262
262
return ;
263
263
}
264
264
}
@@ -2558,21 +2558,16 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
2558
2558
}
2559
2559
2560
2560
match item. kind {
2561
- ItemKind :: Impl {
2562
- ref generics,
2563
- self_ty : ref ty,
2564
- ref items,
2565
- ..
2566
- } => {
2561
+ ItemKind :: Impl ( ref impl_) => {
2567
2562
let mut vis = ImplicitHasherTypeVisitor :: new ( cx) ;
2568
- vis. visit_ty ( ty ) ;
2563
+ vis. visit_ty ( impl_ . self_ty ) ;
2569
2564
2570
2565
for target in & vis. found {
2571
2566
if differing_macro_contexts ( item. span , target. span ( ) ) {
2572
2567
return ;
2573
2568
}
2574
2569
2575
- let generics_suggestion_span = generics. span . substitute_dummy ( {
2570
+ let generics_suggestion_span = impl_ . generics . span . substitute_dummy ( {
2576
2571
let pos = snippet_opt ( cx, item. span . until ( target. span ( ) ) )
2577
2572
. and_then ( |snip| Some ( item. span . lo ( ) + BytePos ( snip. find ( "impl" ) ? as u32 + 4 ) ) ) ;
2578
2573
if let Some ( pos) = pos {
@@ -2583,7 +2578,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
2583
2578
} ) ;
2584
2579
2585
2580
let mut ctr_vis = ImplicitHasherConstructorVisitor :: new ( cx, target) ;
2586
- for item in items. iter ( ) . map ( |item| cx. tcx . hir ( ) . impl_item ( item. id ) ) {
2581
+ for item in impl_ . items . iter ( ) . map ( |item| cx. tcx . hir ( ) . impl_item ( item. id ) ) {
2587
2582
ctr_vis. visit_impl_item ( item) ;
2588
2583
}
2589
2584
@@ -2596,7 +2591,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
2596
2591
target. type_name( )
2597
2592
) ,
2598
2593
move |diag| {
2599
- suggestion ( cx, diag, generics. span , generics_suggestion_span, target, ctr_vis) ;
2594
+ suggestion ( cx, diag, impl_ . generics . span , generics_suggestion_span, target, ctr_vis) ;
2600
2595
} ,
2601
2596
) ;
2602
2597
}
0 commit comments