@@ -180,9 +180,10 @@ enum SawAbiComponent<'a> {
180
180
SawLifetimeDef ( usize ) ,
181
181
182
182
SawMod ,
183
- SawForeignItem ,
183
+ SawForeignItem ( SawForeignItemComponent ) ,
184
184
SawItem ( SawItemComponent ) ,
185
185
SawTy ( SawTyComponent ) ,
186
+ SawFnDecl ( bool ) ,
186
187
SawGenerics ,
187
188
SawTraitItem ( SawTraitOrImplItemComponent ) ,
188
189
SawImplItem ( SawTraitOrImplItemComponent ) ,
@@ -364,7 +365,7 @@ enum SawItemComponent {
364
365
SawItemConst ,
365
366
SawItemFn ( Unsafety , Constness , Abi ) ,
366
367
SawItemMod ,
367
- SawItemForeignMod ,
368
+ SawItemForeignMod ( Abi ) ,
368
369
SawItemTy ,
369
370
SawItemEnum ,
370
371
SawItemStruct ,
@@ -382,7 +383,7 @@ fn saw_item(node: &Item_) -> SawItemComponent {
382
383
ItemConst ( ..) =>SawItemConst ,
383
384
ItemFn ( _, unsafety, constness, abi, _, _) => SawItemFn ( unsafety, constness, abi) ,
384
385
ItemMod ( ..) => SawItemMod ,
385
- ItemForeignMod ( .. ) => SawItemForeignMod ,
386
+ ItemForeignMod ( ref fm ) => SawItemForeignMod ( fm . abi ) ,
386
387
ItemTy ( ..) => SawItemTy ,
387
388
ItemEnum ( ..) => SawItemEnum ,
388
389
ItemStruct ( ..) => SawItemStruct ,
@@ -393,6 +394,12 @@ fn saw_item(node: &Item_) -> SawItemComponent {
393
394
}
394
395
}
395
396
397
+ #[ derive( Hash ) ]
398
+ enum SawForeignItemComponent {
399
+ Static { mutable : bool } ,
400
+ Fn ,
401
+ }
402
+
396
403
#[ derive( Hash ) ]
397
404
enum SawPatComponent {
398
405
SawPatWild ,
@@ -602,7 +609,17 @@ impl<'a, 'hash, 'tcx> visit::Visitor<'tcx> for StrictVersionHashVisitor<'a, 'has
602
609
fn visit_foreign_item ( & mut self , i : & ' tcx ForeignItem ) {
603
610
debug ! ( "visit_foreign_item: st={:?}" , self . st) ;
604
611
605
- SawForeignItem . hash ( self . st ) ;
612
+ match i. node {
613
+ ForeignItemFn ( ..) => {
614
+ SawForeignItem ( SawForeignItemComponent :: Fn )
615
+ }
616
+ ForeignItemStatic ( _, mutable) => {
617
+ SawForeignItem ( SawForeignItemComponent :: Static {
618
+ mutable : mutable
619
+ } )
620
+ }
621
+ } . hash ( self . st ) ;
622
+
606
623
hash_span ! ( self , i. span) ;
607
624
hash_attrs ! ( self , & i. attrs) ;
608
625
visit:: walk_foreign_item ( self , i)
@@ -639,6 +656,12 @@ impl<'a, 'hash, 'tcx> visit::Visitor<'tcx> for StrictVersionHashVisitor<'a, 'has
639
656
visit:: walk_generics ( self , g)
640
657
}
641
658
659
+ fn visit_fn_decl ( & mut self , fd : & ' tcx FnDecl ) {
660
+ debug ! ( "visit_fn_decl: st={:?}" , self . st) ;
661
+ SawFnDecl ( fd. variadic ) . hash ( self . st ) ;
662
+ visit:: walk_fn_decl ( self , fd)
663
+ }
664
+
642
665
fn visit_trait_item ( & mut self , ti : & ' tcx TraitItem ) {
643
666
debug ! ( "visit_trait_item: st={:?}" , self . st) ;
644
667
0 commit comments