Skip to content

Commit

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

changed E0067 to new error format

Updated E0067 to new error format.
Part of rust-lang#35233
Fixes rust-lang#35502

Passes all the tests when running:
`python src/bootstrap/bootstrap.py --step check-cfail --stage 1`

**This seems strange, given that the format for E0067 has been changed.**
It feels like it should fail some unit tests maybe?

Let me know if I'm mistaken. Otherwise I can create a unit test for it.

Thanks for letting me help!

r? @jonathandturner
  • Loading branch information
eddyb committed Aug 14, 2016
2 parents c5a9228 + bd90a16 commit 15f66ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc_typeck/check/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {

let tcx = self.tcx;
if !tcx.expr_is_lval(lhs_expr) {
span_err!(tcx.sess, lhs_expr.span, E0067, "invalid left-hand side expression");
struct_span_err!(
tcx.sess, lhs_expr.span,
E0067, "invalid left-hand side expression")
.span_label(
lhs_expr.span,
&format!("invalid expression for left-hand side"))
.emit();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/E0067.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ use std::collections::LinkedList;
fn main() {
LinkedList::new() += 1; //~ ERROR E0368
//~^ ERROR E0067
//~^^ NOTE invalid expression for left-hand side
//~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
}

0 comments on commit 15f66ad

Please sign in to comment.