2023-10-04 20:50:00 -05:00
|
|
|
error[E0277]: expected a `FnMut(char)` closure, found `String`
|
2022-11-27 16:49:18 -06:00
|
|
|
--> $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: the trait bound `String: Pattern<'_>` is not satisfied
|
|
|
|
= 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"))
|
|
|
|
| ++ +
|
|
|
|
|
2023-10-04 20:50:00 -05:00
|
|
|
error[E0277]: expected a `FnMut(char)` closure, found `String`
|
2022-11-27 16:49:18 -06:00
|
|
|
--> $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: the trait bound `String: Pattern<'_>` is not satisfied
|
|
|
|
= 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`.
|