@@ -102,7 +102,7 @@ pub struct HirEqInterExpr<'a, 'b, 'tcx> {
102102impl HirEqInterExpr < ' _ , ' _ , ' _ > {
103103 pub fn eq_stmt ( & mut self , left : & Stmt < ' _ > , right : & Stmt < ' _ > ) -> bool {
104104 match ( & left. kind , & right. kind ) {
105- ( & StmtKind :: Local ( l) , & StmtKind :: Local ( r) ) => {
105+ ( & StmtKind :: Local ( l, ) , & StmtKind :: Local ( r, ) ) => {
106106 // This additional check ensures that the type of the locals are equivalent even if the init
107107 // expression or type have some inferred parts.
108108 if let Some ( ( typeck_lhs, typeck_rhs) ) = self . inner . maybe_typeck_results {
@@ -117,6 +117,7 @@ impl HirEqInterExpr<'_, '_, '_> {
117117 // these only get added if the init and type is equal.
118118 both ( & l. init , & r. init , |l, r| self . eq_expr ( l, r) )
119119 && 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) )
120121 && self . eq_pat ( l. pat , r. pat )
121122 } ,
122123 ( & 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> {
921922 std:: mem:: discriminant ( & b. kind ) . hash ( & mut self . s ) ;
922923
923924 match & b. kind {
924- StmtKind :: Local ( local) => {
925+ StmtKind :: Local ( local, ) => {
925926 self . hash_pat ( local. pat ) ;
926927 if let Some ( init) = local. init {
927928 self . hash_expr ( init) ;
928929 }
930+ if let Some ( els) = local. els {
931+ self . hash_block ( els) ;
932+ }
929933 } ,
930934 StmtKind :: Item ( ..) => { } ,
931935 StmtKind :: Expr ( expr) | StmtKind :: Semi ( expr) => {
0 commit comments