@@ -220,8 +220,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
220
220
ExprKind :: Lit ( ref lit) => self . check_lit ( & lit, expected) ,
221
221
ExprKind :: Binary ( op, ref lhs, ref rhs) => self . check_binop ( expr, op, lhs, rhs) ,
222
222
ExprKind :: Assign ( ref lhs, ref rhs, ref span) => {
223
- self . check_binop_assign ( expr, op , lhs, rhs)
223
+ self . check_expr_assign ( expr, expected , lhs, rhs, span )
224
224
}
225
+ ExprKind :: AssignOp ( op, ref lhs, ref rhs) => self . check_binop_assign ( expr, op, lhs, rhs) ,
225
226
ExprKind :: Unary ( unop, ref oprnd) => {
226
227
self . check_expr_unary ( unop, oprnd, expected, needs, expr)
227
228
}
@@ -730,8 +731,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
730
731
comps. iter ( ) . all ( |e| self . is_destructuring_place_expr ( e) )
731
732
}
732
733
ExprKind :: Struct ( _path, fields, rest) => {
733
- rest. as_ref ( ) . map ( |e| self . is_destructuring_place_expr ( e) ) . unwrap_or ( true ) &&
734
- fields. iter ( ) . all ( |f| self . is_destructuring_place_expr ( & f. expr ) )
734
+ rest. as_ref ( ) . map ( |e| self . is_destructuring_place_expr ( e) ) . unwrap_or ( true )
735
+ && fields. iter ( ) . all ( |f| self . is_destructuring_place_expr ( & f. expr ) )
735
736
}
736
737
_ => expr. is_syntactic_place_expr ( ) ,
737
738
}
@@ -752,9 +753,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
752
753
err. span_label ( lhs. span , "cannot assign to this expression" ) ;
753
754
if self . is_destructuring_place_expr ( lhs) {
754
755
err. note ( "destructuring assignments are not currently supported" ) ;
755
- err. note (
756
- "for more information, see https://github.com/rust-lang/rfcs/issues/372" ,
757
- ) ;
756
+ err. note ( "for more information, see https://github.com/rust-lang/rfcs/issues/372" ) ;
758
757
}
759
758
err. emit ( ) ;
760
759
}
0 commit comments