File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
221221 ) => {
222222 eq_closure_binder ( lb, rb)
223223 && lc == rc
224- && la . map_or ( false , CoroutineKind :: is_async ) == ra . map_or ( false , CoroutineKind :: is_async )
224+ && eq_coroutine_kind ( * la , * ra )
225225 && lm == rm
226226 && eq_fn_decl ( lf, rf)
227227 && eq_expr ( le, re)
@@ -241,6 +241,16 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
241241 }
242242}
243243
244+ fn eq_coroutine_kind ( a : Option < CoroutineKind > , b : Option < CoroutineKind > ) -> bool {
245+ match ( a, b) {
246+ ( Some ( CoroutineKind :: Async { .. } ) , Some ( CoroutineKind :: Async { .. } ) )
247+ | ( Some ( CoroutineKind :: Gen { .. } ) , Some ( CoroutineKind :: Gen { .. } ) )
248+ | ( Some ( CoroutineKind :: AsyncGen { .. } ) , Some ( CoroutineKind :: AsyncGen { .. } ) )
249+ | ( None , None ) => true ,
250+ _ => false ,
251+ }
252+ }
253+
244254pub fn eq_field ( l : & ExprField , r : & ExprField ) -> bool {
245255 l. is_placeholder == r. is_placeholder
246256 && eq_id ( l. ident , r. ident )
You can’t perform that action at this time.
0 commit comments