mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
772315de7c
Use a GAT for `Searcher` associated type because this trait is always implemented for every lifetime anyway.
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
error[E0277]: the trait bound `String: Pattern` is not satisfied
|
|
--> $DIR/issue-104961.rs:4:19
|
|
|
|
|
LL | x.starts_with("hi".to_string() + " you")
|
|
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Pattern` is not implemented for `String`
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
= note: required for `String` to implement `Pattern`
|
|
note: required by a bound in `core::str::<impl str>::starts_with`
|
|
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
|
help: consider borrowing here
|
|
|
|
|
LL | x.starts_with(&("hi".to_string() + " you"))
|
|
| ++ +
|
|
|
|
error[E0277]: the trait bound `String: Pattern` is not satisfied
|
|
--> $DIR/issue-104961.rs:9:19
|
|
|
|
|
LL | x.starts_with("hi".to_string())
|
|
| ----------- ^^^^^^^^^^^^^^^^ the trait `Pattern` is not implemented for `String`
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
= note: required for `String` to implement `Pattern`
|
|
note: required by a bound in `core::str::<impl str>::starts_with`
|
|
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
|
help: consider borrowing here
|
|
|
|
|
LL | x.starts_with(&"hi".to_string())
|
|
| +
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|