summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-53692.rs
blob: 6f6707be5f651c920d0cef778ac2c62fdefe242c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-rustfix
#![allow(unused_variables)]

fn main() {
    let items = vec![1, 2, 3];
    let ref_items: &[i32] = &items;
    let items_clone: Vec<i32> = ref_items.clone();
    //~^ ERROR mismatched types

    // in that case no suggestion will be triggered
    let items_clone_2: Vec<i32> = items.clone();

    let s = "hi";
    let string: String = s.clone();
    //~^ ERROR mismatched types

    // in that case no suggestion will be triggered
    let s2 = "hi";
    let string_2: String = s2.to_string();
}