2022-11-27 16:49:18 -06:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
fn foo(x: &str) -> bool {
|
|
|
|
x.starts_with("hi".to_string() + " you")
|
2024-07-08 07:30:17 -05:00
|
|
|
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
2022-11-27 16:49:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo2(x: &str) -> bool {
|
|
|
|
x.starts_with("hi".to_string())
|
2024-07-08 07:30:17 -05:00
|
|
|
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
2022-11-27 16:49:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo("hi you");
|
|
|
|
foo2("hi");
|
|
|
|
}
|