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:
commit
c5a9228068
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user