rust/tests/ui/suggestions/issue-104961.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
354 B
Rust
Raw Permalink Normal View History

//@ 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");
}