2019-01-14 13:10:45 +00:00
|
|
|
error[E0277]: the type `[{integer}]` cannot be indexed by `u8`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/indexing-requires-a-uint.rs:6:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | [0][0u8];
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
|
|
|
|
|
|
|
|
|
= help: the trait `std::slice::SliceIndex<[{integer}]>` is not implemented for `u8`
|
|
|
|
= note: required because of the requirements on the impl of `std::ops::Index<u8>` for `[{integer}]`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/indexing-requires-a-uint.rs:12:18
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
|
|
|
|
| ^ expected isize, found usize
|
2019-05-03 17:41:26 +00:00
|
|
|
help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit
|
2019-04-21 22:44:23 +00:00
|
|
|
|
|
|
|
|
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0277, E0308.
|
2018-08-08 12:28:26 +00:00
|
|
|
For more information about an error, try `rustc --explain E0277`.
|