rust/tests/ui/indexing/point-at-index-for-obligation-failure.stderr
2026-02-11 18:08:18 +09:00

18 lines
693 B
Text

error[E0277]: the trait bound `String: Borrow<&str>` is not satisfied
--> $DIR/point-at-index-for-obligation-failure.rs:4:14
|
LL | let _b = a[
| ______________^
LL | | &s
LL | | ];
| |_____^ the trait `Borrow<&str>` is not implemented for `String`
|
help: the trait `Borrow<&_>` is not implemented for `String`
but trait `Borrow<_>` is implemented for it
--> $SRC_DIR/alloc/src/str.rs:LL:COL
= help: for that trait implementation, expected `str`, found `&str`
= note: required for `HashMap<String, String>` to implement `Index<&&str>`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.