rust/src/test/ui/indexing-requires-a-uint.stderr
2018-12-25 21:08:33 -07:00

20 lines
863 B
Plaintext

error[E0277]: the trait bound `u8: std::slice::SliceIndex<[{integer}]>` is not satisfied
--> $DIR/indexing-requires-a-uint.rs:6:5
|
LL | [0][0u8]; //~ ERROR: the trait bound `u8: std::slice::SliceIndex<[{integer}]>` is not satisfied
| ^^^^^^^^ 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
--> $DIR/indexing-requires-a-uint.rs:12:18
|
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
| ^ expected isize, found usize
error: aborting due to 2 previous errors
Some errors occurred: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.