From b6e9ed1e407b36270df9df08cdee67828efb5e6d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 12 Jun 2017 19:02:09 +0200 Subject: [PATCH] Use new macro instead --- src/librustc_typeck/check/mod.rs | 6 +++--- src/librustc_typeck/diagnostics.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index d428852d39e8..205ed515bd73 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 5342fb6cc878..2480650ad1be 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 = vec![0, 1, 2, 3];