updated E0070 to new error format

This commit is contained in:
Clement Miao 2016-08-12 10:15:54 -07:00
parent 8787a12334
commit 4ab00e4397
2 changed files with 8 additions and 2 deletions

View File

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

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