summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/chain-method-call-mutation-in-place.rs
blob: 7a4c747961c623d34d6b34017e1cd7aa27ce292d (plain)
1
2
3
4
5
6
7
8
fn main() {
    let x: Vec<i32> = vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i); //~ ERROR mismatched types
    vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i).sort(); //~ ERROR no method named `sort` found for unit type `()` in the current scope
}

fn foo(mut s: String) -> String {
    s.push_str("asdf") //~ ERROR mismatched types
}