about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-08-14 20:29:51 +0300
committerGitHub <noreply@github.com>2016-08-14 20:29:51 +0300
commit15f66ad326555011abaccaa2d4a758833cc7d2a1 (patch)
tree7044d64b0415a285358fe8b6eb636660e94faf4a /src
parentc5a9228068eb698bf53d55df80fd11dc4a47e258 (diff)
parentbd90a1615111b8fff54f9b5fcf25491d42047c0f (diff)
downloadrust-15f66ad326555011abaccaa2d4a758833cc7d2a1.tar.gz
rust-15f66ad326555011abaccaa2d4a758833cc7d2a1.zip
Rollup merge of #35616 - clementmiao:E0067_new_error_format, r=jonathandturner
changed E0067 to new error format

Updated E0067 to new error format.
Part of #35233
Fixes #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
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/op.rs8
-rw-r--r--src/test/compile-fail/E0067.rs2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs
index 63487683ec3..cdca988084c 100644
--- a/src/librustc_typeck/check/op.rs
+++ b/src/librustc_typeck/check/op.rs
@@ -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();
         }
     }
 
diff --git a/src/test/compile-fail/E0067.rs b/src/test/compile-fail/E0067.rs
index a3fc30ee1c7..56d2e828062 100644
--- a/src/test/compile-fail/E0067.rs
+++ b/src/test/compile-fail/E0067.rs
@@ -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<_>`
 }