From 4ab00e439768937e4079a27957255086b32a6501 Mon Sep 17 00:00:00 2001 From: Clement Miao Date: Fri, 12 Aug 2016 10:15:54 -0700 Subject: [PATCH] updated E0070 to new error format --- src/librustc_typeck/check/mod.rs | 9 +++++++-- src/test/compile-fail/issue-26093.rs | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 36fdba3706109..499b1c6487974 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3463,8 +3463,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let tcx = self.tcx; if !tcx.expr_is_lval(&lhs) { - span_err!(tcx.sess, expr.span, E0070, - "invalid left-hand side expression"); + struct_span_err!( + tcx.sess, expr.span, E0070, + "invalid left-hand side expression") + .span_label( + expr.span, + &format!("left-hand of expression not valid")) + .emit(); } let lhs_ty = self.expr_ty(&lhs); diff --git a/src/test/compile-fail/issue-26093.rs b/src/test/compile-fail/issue-26093.rs index 2f43388b7afb0..39a53648ccf8a 100644 --- a/src/test/compile-fail/issue-26093.rs +++ b/src/test/compile-fail/issue-26093.rs @@ -12,6 +12,7 @@ macro_rules! not_an_lvalue { ($thing:expr) => { $thing = 42; //~^ ERROR invalid left-hand side expression + //~^^ NOTE left-hand of expression not valid } }