@@ -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
@@ -1033,6 +1038,13 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
10331038 std:: mem:: discriminant ( & lop) . hash ( & mut self . s ) ;
10341039 self . hash_expr ( le) ;
10351040 } ,
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+ }
10361048 ExprKind :: Err ( _) => { } ,
10371049 }
10381050 }
@@ -1242,6 +1254,9 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
12421254 TyKind :: Typeof ( anon_const) => {
12431255 self . hash_body ( anon_const. body ) ;
12441256 } ,
1257+ TyKind :: UnsafeBinder ( binder) => {
1258+ self . hash_ty ( binder. inner_ty ) ;
1259+ }
12451260 TyKind :: Err ( _)
12461261 | TyKind :: Infer
12471262 | TyKind :: Never
0 commit comments