fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1002 B23 linesraw
1error[E0277]: the type `[{integer}]` cannot be indexed by `u8`
2  --> $DIR/indexing-requires-a-uint.rs:6:5
3   |
4LL |     [0][0u8];
5   |     ^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
6   |
7   = help: the trait `std::slice::SliceIndex<[{integer}]>` is not implemented for `u8`
8   = note: required because of the requirements on the impl of `std::ops::Index<u8>` for `[{integer}]`
9
10error[E0308]: mismatched types
11  --> $DIR/indexing-requires-a-uint.rs:12:18
12   |
13LL |     bar::<isize>(i);  // i should not be re-coerced back to an isize
14   |                  ^ expected isize, found usize
15help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit
16   |
17LL |     bar::<isize>(i.try_into().unwrap());  // i should not be re-coerced back to an isize
18   |                  ^^^^^^^^^^^^^^^^^^^^^
19
20error: aborting due to 2 previous errors
21
22Some errors have detailed explanations: E0277, E0308.
23For more information about an error, try `rustc --explain E0277`.