mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
3ad92c9f23
When encountering an unmet predicate, when we point at the trait impls that do exist, if they are all for the same self type, tweak the wording to make it less verbose.
20 lines
656 B
Plaintext
20 lines
656 B
Plaintext
error[E0277]: the type `[{integer}]` cannot be indexed by `i32`
|
|
--> $DIR/index-help.rs:3:7
|
|
|
|
|
LL | x[0i32];
|
|
| ^^^^ slice indices are of type `usize` or ranges of `usize`
|
|
|
|
|
= help: the trait `SliceIndex<[{integer}]>` is not implemented for `i32`
|
|
help: `usize` implements trait `SliceIndex<T>`
|
|
--> $SRC_DIR/core/src/slice/index.rs:LL:COL
|
|
|
|
|
= note: `SliceIndex<[T]>`
|
|
--> $SRC_DIR/core/src/bstr/traits.rs:LL:COL
|
|
|
|
|
= note: `SliceIndex<ByteStr>`
|
|
= note: required for `Vec<{integer}>` to implement `Index<i32>`
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|