diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-08-14 20:29:51 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-14 20:29:51 +0300 |
| commit | c5a9228068eb698bf53d55df80fd11dc4a47e258 (patch) | |
| tree | b510c2cc3c682ba839ad0da23a732c93da9c9d45 /src | |
| parent | 80510b800a633895247811049faef321bd6bff92 (diff) | |
| parent | 4ab00e439768937e4079a27957255086b32a6501 (diff) | |
| download | rust-c5a9228068eb698bf53d55df80fd11dc4a47e258.tar.gz rust-c5a9228068eb698bf53d55df80fd11dc4a47e258.zip | |
Rollup merge of #35615 - clementmiao:E0070_new_error_format, r=jonathandturner
Update E0070 to new error format Updated E0070 to new error format. Part of #35233 Fixes #35503 Thanks for letting me help! r? @jonathandturner
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 9 | ||||
| -rw-r--r-- | 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 0c8e6d990a6..e99a95e4135 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3520,8 +3520,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 2f43388b7af..39a53648ccf 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 } } |
