Files
Esteban Küber 3ad92c9f23 On E0277 tweak help when single type impls traits
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.
2026-03-21 02:24:36 +00:00

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`.