]> git.lizzy.rs Git - rust.git/blob - src/test/ui/on-unimplemented/slice-index.stderr
Rollup merge of #76275 - FedericoPonzi:immutable-write-impl-73836, r=dtolnay
[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    = note: required because of the requirements on the impl of `Index<i32>` for `[i32]`
9
10 error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
11   --> $DIR/slice-index.rs:9:5
12    |
13 LL |     x[..1i32];
14    |     ^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
15    |
16    = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
17    = note: required because of the requirements on the impl of `Index<RangeTo<i32>>` for `[i32]`
18
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0277`.