@@ -370,6 +370,10 @@ impl HirEqInterExpr<'_, '_, '_> {
370
370
&& self . eq_expr ( l_receiver, r_receiver)
371
371
&& self . eq_exprs ( l_args, r_args)
372
372
} ,
373
+ ( & ExprKind :: UnsafeBinderCast ( lkind, le, None ) , & ExprKind :: UnsafeBinderCast ( rkind, re, None ) ) =>
374
+ lkind == rkind && self . eq_expr ( le, re) ,
375
+ ( & ExprKind :: UnsafeBinderCast ( lkind, le, Some ( lt) ) , & ExprKind :: UnsafeBinderCast ( rkind, re, Some ( rt) ) ) =>
376
+ lkind == rkind && self . eq_expr ( le, re) && self . eq_ty ( lt, rt) ,
373
377
( & ExprKind :: OffsetOf ( l_container, l_fields) , & ExprKind :: OffsetOf ( r_container, r_fields) ) => {
374
378
self . eq_ty ( l_container, r_container) && over ( l_fields, r_fields, |l, r| l. name == r. name )
375
379
} ,
@@ -424,6 +428,7 @@ impl HirEqInterExpr<'_, '_, '_> {
424
428
| & ExprKind :: Type ( ..)
425
429
| & ExprKind :: Unary ( ..)
426
430
| & ExprKind :: Yield ( ..)
431
+ | & ExprKind :: UnsafeBinderCast ( ..)
427
432
428
433
// --- Special cases that do not have a positive branch.
429
434
@@ -1032,6 +1037,13 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
1032
1037
std:: mem:: discriminant ( & lop) . hash ( & mut self . s ) ;
1033
1038
self . hash_expr ( le) ;
1034
1039
} ,
1040
+ ExprKind :: UnsafeBinderCast ( kind, expr, ty) => {
1041
+ std:: mem:: discriminant ( & kind) . hash ( & mut self . s ) ;
1042
+ self . hash_expr ( expr) ;
1043
+ if let Some ( ty) = ty {
1044
+ self . hash_ty ( ty) ;
1045
+ }
1046
+ }
1035
1047
ExprKind :: Err ( _) => { } ,
1036
1048
}
1037
1049
}
@@ -1241,6 +1253,9 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
1241
1253
TyKind :: Typeof ( anon_const) => {
1242
1254
self . hash_body ( anon_const. body ) ;
1243
1255
} ,
1256
+ TyKind :: UnsafeBinder ( binder) => {
1257
+ self . hash_ty ( binder. inner_ty ) ;
1258
+ }
1244
1259
TyKind :: Err ( _)
1245
1260
| TyKind :: Infer
1246
1261
| TyKind :: Never
0 commit comments