@@ -211,9 +211,8 @@ fn current_op(p: &Parser<'_>) -> (u8, SyntaxKind, Associativity) {
211211 T ! [ >] if p. at ( T ! [ >>] ) => ( 9 , T ! [ >>] , Left ) ,
212212 T ! [ >] if p. at ( T ! [ >=] ) => ( 5 , T ! [ >=] , Left ) ,
213213 T ! [ >] => ( 5 , T ! [ >] , Left ) ,
214- T ! [ =] if p. at ( T ! [ =>] ) => NOT_AN_OP ,
215214 T ! [ =] if p. at ( T ! [ ==] ) => ( 5 , T ! [ ==] , Left ) ,
216- T ! [ =] => ( 1 , T ! [ =] , Right ) ,
215+ T ! [ =] if !p . at ( T ! [ => ] ) => ( 1 , T ! [ =] , Right ) ,
217216 T ! [ <] if p. at ( T ! [ <=] ) => ( 5 , T ! [ <=] , Left ) ,
218217 T ! [ <] if p. at ( T ! [ <<=] ) => ( 1 , T ! [ <<=] , Right ) ,
219218 T ! [ <] if p. at ( T ! [ <<] ) => ( 9 , T ! [ <<] , Left ) ,
@@ -247,7 +246,7 @@ fn current_op(p: &Parser<'_>) -> (u8, SyntaxKind, Associativity) {
247246fn expr_bp (
248247 p : & mut Parser < ' _ > ,
249248 m : Option < Marker > ,
250- mut r : Restrictions ,
249+ r : Restrictions ,
251250 bp : u8 ,
252251) -> Option < ( CompletedMarker , BlockLike ) > {
253252 let m = m. unwrap_or_else ( || {
@@ -295,10 +294,6 @@ fn expr_bp(
295294 let m = lhs. precede ( p) ;
296295 p. bump ( op) ;
297296
298- // test binop_resets_statementness
299- // fn f() { v = {1}&2; }
300- r = Restrictions { prefer_stmt : false , ..r } ;
301-
302297 if is_range {
303298 // test postfix_range
304299 // fn foo() {
@@ -319,6 +314,9 @@ fn expr_bp(
319314 Associativity :: Left => op_bp + 1 ,
320315 Associativity :: Right => op_bp,
321316 } ;
317+
318+ // test binop_resets_statementness
319+ // fn f() { v = {1}&2; }
322320 expr_bp ( p, None , Restrictions { prefer_stmt : false , ..r } , op_bp) ;
323321 lhs = m. complete ( p, if is_range { RANGE_EXPR } else { BIN_EXPR } ) ;
324322 }
@@ -345,7 +343,7 @@ fn lhs(p: &mut Parser<'_>, r: Restrictions) -> Option<(CompletedMarker, BlockLik
345343 T ! [ & ] => {
346344 m = p. start ( ) ;
347345 p. bump ( T ! [ & ] ) ;
348- if p. at_contextual_kw ( T ! [ raw] ) && ( p . nth_at ( 1 , T ! [ mut ] ) || p . nth_at ( 1 , T ! [ const ] ) ) {
346+ if p. at_contextual_kw ( T ! [ raw] ) && [ T ! [ mut ] , T ! [ const ] ] . contains ( & p . nth ( 1 ) ) {
349347 p. bump_remap ( T ! [ raw] ) ;
350348 p. bump_any ( ) ;
351349 } else {
0 commit comments