]> git.lizzy.rs Git - rust.git/blob - tests/ui/on-unimplemented/slice-index.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / on-unimplemented / slice-index.stderr
1 error[E0277]: the type `[i32]` cannot be indexed by `i32`
2   --> $DIR/slice-index.rs:8:7
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 for `[i32]` to implement `Index<i32>`
10
11 error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
12   --> $DIR/slice-index.rs:9:7
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<T>`:
19              <RangeTo<usize> as SliceIndex<[T]>>
20              <RangeTo<usize> as SliceIndex<str>>
21    = note: required for `[i32]` to implement `Index<RangeTo<i32>>`
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0277`.