fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB26 linesraw
1error[E0277]: the type `[i32]` cannot be indexed by `i32`
2  --> $DIR/slice-index.rs:8:7
3   |
4LL |     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<[i32]>` is implemented for `usize`
9   = help: for that trait implementation, expected `usize`, found `i32`
10   = note: required for `[i32]` to implement `Index<i32>`
11
12error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
13  --> $DIR/slice-index.rs:9:7
14   |
15LL |     x[..1i32];
16   |       ^^^^^^ slice indices are of type `usize` or ranges of `usize`
17   |
18   = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
19   = help: the following other types implement trait `SliceIndex<T>`:
20             <RangeTo<usize> as SliceIndex<str>>
21             <RangeTo<usize> as SliceIndex<[T]>>
22   = note: required for `[i32]` to implement `Index<RangeTo<i32>>`
23
24error: aborting due to 2 previous errors
25
26For more information about this error, try `rustc --explain E0277`.