summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-104961.fixed
blob: 520d638b1748f1c4b51fb0a0e998e8c31ae9f672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-rustfix

fn foo(x: &str) -> bool {
    x.starts_with(&("hi".to_string() + " you"))
    //~^ ERROR expected a `FnMut<(char,)>` closure, found `String`
}

fn foo2(x: &str) -> bool {
    x.starts_with(&"hi".to_string())
    //~^ ERROR expected a `FnMut<(char,)>` closure, found `String`
}

fn main() {
    foo("hi you");
    foo2("hi");
}