@@ -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
@@ -1033,6 +1038,13 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
1033
1038
std:: mem:: discriminant ( & lop) . hash ( & mut self . s ) ;
1034
1039
self . hash_expr ( le) ;
1035
1040
} ,
1041
+ ExprKind :: UnsafeBinderCast ( kind, expr, ty) => {
1042
+ std:: mem:: discriminant ( & kind) . hash ( & mut self . s ) ;
1043
+ self . hash_expr ( expr) ;
1044
+ if let Some ( ty) = ty {
1045
+ self . hash_ty ( ty) ;
1046
+ }
1047
+ }
1036
1048
ExprKind :: Err ( _) => { } ,
1037
1049
}
1038
1050
}
@@ -1242,6 +1254,9 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
1242
1254
TyKind :: Typeof ( anon_const) => {
1243
1255
self . hash_body ( anon_const. body ) ;
1244
1256
} ,
1257
+ TyKind :: UnsafeBinder ( binder) => {
1258
+ self . hash_ty ( binder. inner_ty ) ;
1259
+ }
1245
1260
TyKind :: Err ( _)
1246
1261
| TyKind :: Infer
1247
1262
| TyKind :: Never
0 commit comments