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 } }