1
1
use crate :: deriving:: generic:: ty:: * ;
2
2
use crate :: deriving:: generic:: * ;
3
3
use crate :: deriving:: { path_std, pathvec_std} ;
4
- use rustc_ast:: { ExprKind , ItemKind , MetaItem , PatKind } ;
4
+ use rustc_ast:: { ExprKind , ItemKind , MatchKind , MetaItem , PatKind } ;
5
5
use rustc_expand:: base:: { Annotatable , ExtCtxt } ;
6
6
use rustc_span:: symbol:: { sym, Ident } ;
7
7
use rustc_span:: Span ;
@@ -132,7 +132,7 @@ fn cs_partial_cmp(
132
132
// Reference: https://github.com/rust-lang/rust/pull/103659#issuecomment-1328126354
133
133
134
134
if !tag_then_data
135
- && let ExprKind :: Match ( _, arms) = & mut expr1. kind
135
+ && let ExprKind :: Match ( _, arms, _ ) = & mut expr1. kind
136
136
&& let Some ( last) = arms. last_mut ( )
137
137
&& let PatKind :: Wild = last. pat . kind
138
138
{
@@ -146,7 +146,7 @@ fn cs_partial_cmp(
146
146
) ;
147
147
let neq_arm =
148
148
cx. arm ( span, cx. pat_ident ( span, test_id) , cx. expr_ident ( span, test_id) ) ;
149
- cx. expr_match ( span, expr2, thin_vec ! [ eq_arm, neq_arm] )
149
+ cx. expr_match ( span, expr2, thin_vec ! [ eq_arm, neq_arm] , MatchKind :: Prefix )
150
150
}
151
151
}
152
152
CsFold :: Fieldless => cx. expr_some ( span, cx. expr_path ( equal_path. clone ( ) ) ) ,
0 commit comments