blob: 3019242880f82fafd2cf9a9731a2c567175ef7ea [file] [log] [blame] [edit]
//@ run-rustfix
fn foo(x: &str) -> bool {
x.starts_with(&("hi".to_string() + " you"))
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
}
fn foo2(x: &str) -> bool {
x.starts_with(&"hi".to_string())
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
}
fn main() {
foo("hi you");
foo2("hi");
}