]> git.lizzy.rs Git - rust.git/blob - src/test/ui/on-unimplemented/slice-index.stderr
Dedup logic and improve output for other types that impl trait
[rust.git] / src / test / ui / on-unimplemented / slice-index.stderr
1 error[E0277]: the type `[i32]` cannot be indexed by `i32`
2   --> $DIR/slice-index.rs:8:5
3    |
4 LL |     x[1i32];
5    |     ^^^^^^^ slice indices are of type `usize` or ranges of `usize`
6    |
7    = help: the trait `SliceIndex<[i32]>` is not implemented for `i32`
8    = help: the trait `SliceIndex<[T]>` is implemented for `usize`
9    = note: required because of the requirements on the impl of `Index<i32>` for `[i32]`
10
11 error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
12   --> $DIR/slice-index.rs:9:5
13    |
14 LL |     x[..1i32];
15    |     ^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
16    |
17    = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
18    = help: the following other types implement trait `SliceIndex<str>`:
19              <RangeTo<usize> as SliceIndex<[T]>>
20              <RangeTo<usize> as SliceIndex<str>>
21    = note: required because of the requirements on the impl of `Index<RangeTo<i32>>` for `[i32]`
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0277`.