Skip to content

Commit c5a9228

Browse files
authored
Rollup merge of rust-lang#35615 - clementmiao:E0070_new_error_format, 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
2 parents 80510b8 + 4ab00e4 commit c5a9228

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/librustc_typeck/check/mod.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -3520,8 +3520,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
35203520

35213521
let tcx = self.tcx;
35223522
if !tcx.expr_is_lval(&lhs) {
3523-
span_err!(tcx.sess, expr.span, E0070,
3524-
"invalid left-hand side expression");
3523+
struct_span_err!(
3524+
tcx.sess, expr.span, E0070,
3525+
"invalid left-hand side expression")
3526+
.span_label(
3527+
expr.span,
3528+
&format!("left-hand of expression not valid"))
3529+
.emit();
35253530
}
35263531

35273532
let lhs_ty = self.expr_ty(&lhs);

src/test/compile-fail/issue-26093.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ macro_rules! not_an_lvalue {
1212
($thing:expr) => {
1313
$thing = 42;
1414
//~^ ERROR invalid left-hand side expression
15+
//~^^ NOTE left-hand of expression not valid
1516
}
1617
}
1718

0 commit comments

Comments
 (0)