@@ -370,6 +370,10 @@ impl HirEqInterExpr<'_, '_, '_> {
370370 && self . eq_expr ( l_receiver, r_receiver)
371371 && self . eq_exprs ( l_args, r_args)
372372 } ,
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) ,
373377 ( & ExprKind :: OffsetOf ( l_container, l_fields) , & ExprKind :: OffsetOf ( r_container, r_fields) ) => {
374378 self . eq_ty ( l_container, r_container) && over ( l_fields, r_fields, |l, r| l. name == r. name )
375379 } ,
@@ -424,6 +428,7 @@ impl HirEqInterExpr<'_, '_, '_> {
424428 | & ExprKind :: Type ( ..)
425429 | & ExprKind :: Unary ( ..)
426430 | & ExprKind :: Yield ( ..)
431+ | & ExprKind :: UnsafeBinderCast ( ..)
427432
428433 // --- Special cases that do not have a positive branch.
429434
@@ -1032,6 +1037,13 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
10321037 std:: mem:: discriminant ( & lop) . hash ( & mut self . s ) ;
10331038 self . hash_expr ( le) ;
10341039 } ,
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+ }
10351047 ExprKind :: Err ( _) => { } ,
10361048 }
10371049 }
@@ -1241,6 +1253,9 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
12411253 TyKind :: Typeof ( anon_const) => {
12421254 self . hash_body ( anon_const. body ) ;
12431255 } ,
1256+ TyKind :: UnsafeBinder ( binder) => {
1257+ self . hash_ty ( binder. inner_ty ) ;
1258+ }
12441259 TyKind :: Err ( _)
12451260 | TyKind :: Infer
12461261 | TyKind :: Never
0 commit comments