about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-06-12 19:02:09 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-06-15 10:33:46 +0200
commitb6e9ed1e407b36270df9df08cdee67828efb5e6d (patch)
tree82fca268c6bb052586a06c974b4fb858dfa4be5e
parentf8d36581479e929f4bd12e506d70b1552948925e (diff)
downloadrust-b6e9ed1e407b36270df9df08cdee67828efb5e6d.tar.gz
rust-b6e9ed1e407b36270df9df08cdee67828efb5e6d.zip
Use new macro instead
-rw-r--r--src/librustc_typeck/check/mod.rs6
-rw-r--r--src/librustc_typeck/diagnostics.rs4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index d428852d39e..205ed515bd7 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -3889,9 +3889,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
                           element_ty
                       }
                       None => {
-                          let mut err = struct_span_err!(tcx.sess, expr.span, E0608,
-                                                         "cannot index into a value of type `{}`",
-                                                         base_t);
+                          let mut err = type_error_struct!(tcx.sess, expr.span, base_t, E0608,
+                                                           "cannot index into a value of type `{}`",
+                                                           base_t);
                           // Try to give some advice about indexing tuples.
                           if let ty::TyTuple(..) = base_t.sty {
                               let mut needs_note = true;
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 5342fb6cc87..2480650ad1b 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -4105,8 +4105,8 @@ Erroneous code example:
 0u8[2]; // error: cannot index into a value of type `u8`
 ```
 
-To be able to index a value from a type, it needs to implement the
-`std::ops::Index` trait. Example:
+To be able to index into a type it needs to implement the `std::ops::Index`
+trait. Example:
 
 ```
 let v: Vec<u8> = vec![0, 1, 2, 3];