1 error[E0277]: the type `[i32]` cannot be indexed by `i32`
2 --> $DIR/slice-index.rs:8:7
5 | ^^^^ slice indices are of type `usize` or ranges of `usize`
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]`
11 error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
12 --> $DIR/slice-index.rs:9:7
15 | ^^^^^^ slice indices are of type `usize` or ranges of `usize`
17 = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
18 = help: the following other types implement trait `SliceIndex<T>`:
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]`
23 error: aborting due to 2 previous errors
25 For more information about this error, try `rustc --explain E0277`.