Skip to content

Commit

Permalink
Rollup merge of rust-lang#35615 - clementmiao:E0070_new_error_format,…
Browse files Browse the repository at this point in the history
… r=jonathandturner

Update E0070 to new error format

Updated E0070 to new error format.
Part of rust-lang#35233
Fixes rust-lang#35503

Thanks for letting me help!

r? @jonathandturner
  • Loading branch information
eddyb committed Aug 14, 2016
2 parents 80510b8 + 4ab00e4 commit c5a9228
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-26093.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit c5a9228

Please sign in to comment.