From bd90a1615111b8fff54f9b5fcf25491d42047c0f Mon Sep 17 00:00:00 2001 From: Clement Miao Date: Sat, 13 Aug 2016 00:03:04 -0700 Subject: [PATCH] updated E0067 to new error format --- src/librustc_typeck/check/op.rs | 8 +++++++- src/test/compile-fail/E0067.rs | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 63487683ec3b9..cdca988084cce 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -41,7 +41,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let tcx = self.tcx; if !tcx.expr_is_lval(lhs_expr) { - span_err!(tcx.sess, lhs_expr.span, E0067, "invalid left-hand side expression"); + struct_span_err!( + tcx.sess, lhs_expr.span, + E0067, "invalid left-hand side expression") + .span_label( + lhs_expr.span, + &format!("invalid expression for left-hand side")) + .emit(); } } diff --git a/src/test/compile-fail/E0067.rs b/src/test/compile-fail/E0067.rs index a3fc30ee1c71a..56d2e82806230 100644 --- a/src/test/compile-fail/E0067.rs +++ b/src/test/compile-fail/E0067.rs @@ -13,4 +13,6 @@ use std::collections::LinkedList; fn main() { LinkedList::new() += 1; //~ ERROR E0368 //~^ ERROR E0067 + //~^^ NOTE invalid expression for left-hand side + //~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>` }