fork/rust

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

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

master
3.8 KiB91 linesraw
1error[E0277]: the type `[isize]` cannot be indexed by `u8`
2  --> $DIR/integral-indexing.rs:6:7
3   |
4LL |     v[3u8];
5   |       ^^^ slice indices are of type `usize` or ranges of `usize`
6   |
7   = help: the trait `SliceIndex<[isize]>` is not implemented for `u8`
8   = help: the trait `SliceIndex<[isize]>` is implemented for `usize`
9   = help: for that trait implementation, expected `usize`, found `u8`
10   = note: required for `Vec<isize>` to implement `Index<u8>`
11
12error[E0277]: the type `[isize]` cannot be indexed by `i8`
13  --> $DIR/integral-indexing.rs:7:7
14   |
15LL |     v[3i8];
16   |       ^^^ slice indices are of type `usize` or ranges of `usize`
17   |
18   = help: the trait `SliceIndex<[isize]>` is not implemented for `i8`
19   = help: the trait `SliceIndex<[isize]>` is implemented for `usize`
20   = help: for that trait implementation, expected `usize`, found `i8`
21   = note: required for `Vec<isize>` to implement `Index<i8>`
22
23error[E0277]: the type `[isize]` cannot be indexed by `u32`
24  --> $DIR/integral-indexing.rs:8:7
25   |
26LL |     v[3u32];
27   |       ^^^^ slice indices are of type `usize` or ranges of `usize`
28   |
29   = help: the trait `SliceIndex<[isize]>` is not implemented for `u32`
30   = help: the trait `SliceIndex<[isize]>` is implemented for `usize`
31   = help: for that trait implementation, expected `usize`, found `u32`
32   = note: required for `Vec<isize>` to implement `Index<u32>`
33
34error[E0277]: the type `[isize]` cannot be indexed by `i32`
35  --> $DIR/integral-indexing.rs:9:7
36   |
37LL |     v[3i32];
38   |       ^^^^ slice indices are of type `usize` or ranges of `usize`
39   |
40   = help: the trait `SliceIndex<[isize]>` is not implemented for `i32`
41   = help: the trait `SliceIndex<[isize]>` is implemented for `usize`
42   = help: for that trait implementation, expected `usize`, found `i32`
43   = note: required for `Vec<isize>` to implement `Index<i32>`
44
45error[E0277]: the type `[u8]` cannot be indexed by `u8`
46  --> $DIR/integral-indexing.rs:12:18
47   |
48LL |     s.as_bytes()[3u8];
49   |                  ^^^ slice indices are of type `usize` or ranges of `usize`
50   |
51   = help: the trait `SliceIndex<[u8]>` is not implemented for `u8`
52   = help: the trait `SliceIndex<[u8]>` is implemented for `usize`
53   = help: for that trait implementation, expected `usize`, found `u8`
54   = note: required for `[u8]` to implement `Index<u8>`
55
56error[E0277]: the type `[u8]` cannot be indexed by `i8`
57  --> $DIR/integral-indexing.rs:13:18
58   |
59LL |     s.as_bytes()[3i8];
60   |                  ^^^ slice indices are of type `usize` or ranges of `usize`
61   |
62   = help: the trait `SliceIndex<[u8]>` is not implemented for `i8`
63   = help: the trait `SliceIndex<[u8]>` is implemented for `usize`
64   = help: for that trait implementation, expected `usize`, found `i8`
65   = note: required for `[u8]` to implement `Index<i8>`
66
67error[E0277]: the type `[u8]` cannot be indexed by `u32`
68  --> $DIR/integral-indexing.rs:14:18
69   |
70LL |     s.as_bytes()[3u32];
71   |                  ^^^^ slice indices are of type `usize` or ranges of `usize`
72   |
73   = help: the trait `SliceIndex<[u8]>` is not implemented for `u32`
74   = help: the trait `SliceIndex<[u8]>` is implemented for `usize`
75   = help: for that trait implementation, expected `usize`, found `u32`
76   = note: required for `[u8]` to implement `Index<u32>`
77
78error[E0277]: the type `[u8]` cannot be indexed by `i32`
79  --> $DIR/integral-indexing.rs:15:18
80   |
81LL |     s.as_bytes()[3i32];
82   |                  ^^^^ slice indices are of type `usize` or ranges of `usize`
83   |
84   = help: the trait `SliceIndex<[u8]>` is not implemented for `i32`
85   = help: the trait `SliceIndex<[u8]>` is implemented for `usize`
86   = help: for that trait implementation, expected `usize`, found `i32`
87   = note: required for `[u8]` to implement `Index<i32>`
88
89error: aborting due to 8 previous errors
90
91For more information about this error, try `rustc --explain E0277`.