@@ -102,7 +102,7 @@ pub struct HirEqInterExpr<'a, 'b, 'tcx> {
102
102
impl HirEqInterExpr < ' _ , ' _ , ' _ > {
103
103
pub fn eq_stmt ( & mut self , left : & Stmt < ' _ > , right : & Stmt < ' _ > ) -> bool {
104
104
match ( & left. kind , & right. kind ) {
105
- ( & StmtKind :: Local ( l) , & StmtKind :: Local ( r) ) => {
105
+ ( & StmtKind :: Local ( l, ) , & StmtKind :: Local ( r, ) ) => {
106
106
// This additional check ensures that the type of the locals are equivalent even if the init
107
107
// expression or type have some inferred parts.
108
108
if let Some ( ( typeck_lhs, typeck_rhs) ) = self . inner . maybe_typeck_results {
@@ -117,6 +117,7 @@ impl HirEqInterExpr<'_, '_, '_> {
117
117
// these only get added if the init and type is equal.
118
118
both ( & l. init , & r. init , |l, r| self . eq_expr ( l, r) )
119
119
&& both ( & l. ty , & r. ty , |l, r| self . eq_ty ( l, r) )
120
+ && both ( & l. els , & r. els , |l, r| self . eq_block ( l, r) )
120
121
&& self . eq_pat ( l. pat , r. pat )
121
122
} ,
122
123
( & StmtKind :: Expr ( l) , & StmtKind :: Expr ( r) ) | ( & StmtKind :: Semi ( l) , & StmtKind :: Semi ( r) ) => self . eq_expr ( l, r) ,
@@ -921,11 +922,14 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
921
922
std:: mem:: discriminant ( & b. kind ) . hash ( & mut self . s ) ;
922
923
923
924
match & b. kind {
924
- StmtKind :: Local ( local) => {
925
+ StmtKind :: Local ( local, ) => {
925
926
self . hash_pat ( local. pat ) ;
926
927
if let Some ( init) = local. init {
927
928
self . hash_expr ( init) ;
928
929
}
930
+ if let Some ( els) = local. els {
931
+ self . hash_block ( els) ;
932
+ }
929
933
} ,
930
934
StmtKind :: Item ( ..) => { } ,
931
935
StmtKind :: Expr ( expr) | StmtKind :: Semi ( expr) => {
0 commit comments