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
This commit is contained in:
Eduard-Mihai Burtescu 2016-08-14 20:29:51 +03:00 committed by GitHub
commit c5a9228068
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

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