@@ -2,7 +2,7 @@ use crate::consts::{constant_context, constant_simple};
2
2
use crate :: differing_macro_contexts;
3
3
use crate :: source:: snippet_opt;
4
4
use rustc_ast:: ast:: InlineAsmTemplatePiece ;
5
- use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
5
+ use rustc_data_structures:: stable_hasher:: StableHasher ;
6
6
use rustc_hir:: def:: Res ;
7
7
use rustc_hir:: HirIdMap ;
8
8
use rustc_hir:: {
@@ -12,7 +12,6 @@ use rustc_hir::{
12
12
} ;
13
13
use rustc_lexer:: { tokenize, TokenKind } ;
14
14
use rustc_lint:: LateContext ;
15
- use rustc_middle:: ich:: StableHashingContextProvider ;
16
15
use rustc_middle:: ty:: TypeckResults ;
17
16
use rustc_span:: Symbol ;
18
17
use std:: hash:: Hash ;
@@ -571,17 +570,15 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
571
570
self . hash_expr ( r) ;
572
571
} ,
573
572
ExprKind :: AssignOp ( ref o, l, r) => {
574
- o. node
575
- . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
573
+ std:: mem:: discriminant ( & o. node ) . hash ( & mut self . s ) ;
576
574
self . hash_expr ( l) ;
577
575
self . hash_expr ( r) ;
578
576
} ,
579
577
ExprKind :: Block ( b, _) => {
580
578
self . hash_block ( b) ;
581
579
} ,
582
580
ExprKind :: Binary ( op, l, r) => {
583
- op. node
584
- . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
581
+ std:: mem:: discriminant ( & op. node ) . hash ( & mut self . s ) ;
585
582
self . hash_expr ( l) ;
586
583
self . hash_expr ( r) ;
587
584
} ,
@@ -736,7 +733,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
736
733
self . hash_exprs ( v) ;
737
734
} ,
738
735
ExprKind :: Unary ( lop, le) => {
739
- lop . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
736
+ std :: mem :: discriminant ( & lop ) . hash ( & mut self . s ) ;
740
737
self . hash_expr ( le) ;
741
738
} ,
742
739
}
@@ -761,7 +758,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
761
758
self . hash_name ( path. ident . name ) ;
762
759
} ,
763
760
QPath :: LangItem ( lang_item, ..) => {
764
- lang_item . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
761
+ std :: mem :: discriminant ( & lang_item ) . hash ( & mut self . s ) ;
765
762
} ,
766
763
}
767
764
// self.maybe_typeck_results.unwrap().qpath_res(p, id).hash(&mut self.s);
@@ -771,7 +768,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
771
768
std:: mem:: discriminant ( & pat. kind ) . hash ( & mut self . s ) ;
772
769
match pat. kind {
773
770
PatKind :: Binding ( ann, _, _, pat) => {
774
- ann . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
771
+ std :: mem :: discriminant ( & ann ) . hash ( & mut self . s ) ;
775
772
if let Some ( pat) = pat {
776
773
self . hash_pat ( pat) ;
777
774
}
@@ -791,11 +788,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
791
788
if let Some ( e) = e {
792
789
self . hash_expr ( e) ;
793
790
}
794
- i . hash_stable ( & mut self . cx . tcx . get_stable_hashing_context ( ) , & mut self . s ) ;
791
+ std :: mem :: discriminant ( & i ) . hash ( & mut self . s ) ;
795
792
} ,
796
- PatKind :: Ref ( pat, m ) => {
793
+ PatKind :: Ref ( pat, mu ) => {
797
794
self . hash_pat ( pat) ;
798
- m . hash ( & mut self . s ) ;
795
+ std :: mem :: discriminant ( & mu ) . hash ( & mut self . s ) ;
799
796
} ,
800
797
PatKind :: Slice ( l, m, r) => {
801
798
for pat in l {
0 commit comments