@@ -220,8 +220,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
220220 ExprKind :: Lit ( ref lit) => self . check_lit ( & lit, expected) ,
221221 ExprKind :: Binary ( op, ref lhs, ref rhs) => self . check_binop ( expr, op, lhs, rhs) ,
222222 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 )
224224 }
225+ ExprKind :: AssignOp ( op, ref lhs, ref rhs) => self . check_binop_assign ( expr, op, lhs, rhs) ,
225226 ExprKind :: Unary ( unop, ref oprnd) => {
226227 self . check_expr_unary ( unop, oprnd, expected, needs, expr)
227228 }
@@ -730,8 +731,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
730731 comps. iter ( ) . all ( |e| self . is_destructuring_place_expr ( e) )
731732 }
732733 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 ) )
735736 }
736737 _ => expr. is_syntactic_place_expr ( ) ,
737738 }
@@ -752,9 +753,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
752753 err. span_label ( lhs. span , "cannot assign to this expression" ) ;
753754 if self . is_destructuring_place_expr ( lhs) {
754755 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" ) ;
758757 }
759758 err. emit ( ) ;
760759 }
0 commit comments