@@ -347,6 +347,10 @@ impl HirEqInterExpr<'_, '_, '_> {
347
347
} ,
348
348
( & ExprKind :: Tup ( l_tup) , & ExprKind :: Tup ( r_tup) ) => self . eq_exprs ( l_tup, r_tup) ,
349
349
( & ExprKind :: Type ( le, lt) , & ExprKind :: Type ( re, rt) ) => self . eq_expr ( le, re) && self . eq_ty ( lt, rt) ,
350
+ ( & ExprKind :: UnsafeBinderCast ( lkind, le, None ) , & ExprKind :: UnsafeBinderCast ( rkind, re, None ) ) =>
351
+ lkind == rkind && self . eq_expr ( le, re) ,
352
+ ( & ExprKind :: UnsafeBinderCast ( lkind, le, Some ( lt) ) , & ExprKind :: UnsafeBinderCast ( rkind, re, Some ( rt) ) ) =>
353
+ lkind == rkind && self . eq_expr ( le, re) && self . eq_ty ( lt, rt) ,
350
354
( & ExprKind :: Unary ( l_op, le) , & ExprKind :: Unary ( r_op, re) ) => l_op == r_op && self . eq_expr ( le, re) ,
351
355
( & ExprKind :: Yield ( le, _) , & ExprKind :: Yield ( re, _) ) => return self . eq_expr ( le, re) ,
352
356
(
@@ -381,6 +385,7 @@ impl HirEqInterExpr<'_, '_, '_> {
381
385
| & ExprKind :: Type ( ..)
382
386
| & ExprKind :: Unary ( ..)
383
387
| & ExprKind :: Yield ( ..)
388
+ | & ExprKind :: UnsafeBinderCast ( ..)
384
389
385
390
// --- Special cases that do not have a positive branch.
386
391
@@ -928,6 +933,13 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
928
933
std:: mem:: discriminant ( & lop) . hash ( & mut self . s ) ;
929
934
self . hash_expr ( le) ;
930
935
} ,
936
+ ExprKind :: UnsafeBinderCast ( kind, e, t) => {
937
+ std:: mem:: discriminant ( & kind) . hash ( & mut self . s ) ;
938
+ self . hash_expr ( e) ;
939
+ if let Some ( t) = t {
940
+ self . hash_ty ( t) ;
941
+ }
942
+ }
931
943
ExprKind :: Err ( _) => { } ,
932
944
}
933
945
}
@@ -1125,6 +1137,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
1125
1137
TyKind :: Typeof ( anon_const) => {
1126
1138
self . hash_body ( anon_const. body ) ;
1127
1139
} ,
1140
+ TyKind :: UnsafeBinder ( binder) => {
1141
+ // FIXME(unsafe_binder): Hash generics...
1142
+ self . hash_ty ( binder. inner_ty ) ;
1143
+ }
1128
1144
TyKind :: Err ( _) | TyKind :: Infer | TyKind :: Never | TyKind :: InferDelegation ( ..) | TyKind :: AnonAdt ( _) => { } ,
1129
1145
}
1130
1146
}
0 commit comments