Skip to content

Commit b6e9ed1

Browse files
Use new macro instead
1 parent f8d3658 commit b6e9ed1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc_typeck/check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3889,9 +3889,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
38893889
element_ty
38903890
}
38913891
None => {
3892-
let mut err = struct_span_err!(tcx.sess, expr.span, E0608,
3893-
"cannot index into a value of type `{}`",
3894-
base_t);
3892+
let mut err = type_error_struct!(tcx.sess, expr.span, base_t, E0608,
3893+
"cannot index into a value of type `{}`",
3894+
base_t);
38953895
// Try to give some advice about indexing tuples.
38963896
if let ty::TyTuple(..) = base_t.sty {
38973897
let mut needs_note = true;

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4105,8 +4105,8 @@ Erroneous code example:
41054105
0u8[2]; // error: cannot index into a value of type `u8`
41064106
```
41074107
4108-
To be able to index a value from a type, it needs to implement the
4109-
`std::ops::Index` trait. Example:
4108+
To be able to index into a type it needs to implement the `std::ops::Index`
4109+
trait. Example:
41104110
41114111
```
41124112
let v: Vec<u8> = vec![0, 1, 2, 3];

0 commit comments

Comments
 (0)