summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-109991.rs
blob: 918451cb8ee80ae0971a7d16c18763fb01ff2dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
struct S {
    a: usize,
    b: usize,
}

fn main() {
    let a: usize;
    let b: usize;
    let c: usize;

    (c) = (&123); //~ ERROR mismatched types
    (a, b) = (123, &mut 123); //~ ERROR mismatched types

    let x: String;
    (x,) = (1,); //~ ERROR mismatched types

    let x: i32;
    [x] = [&1]; //~ ERROR mismatched types

    let x: &i32;
    [x] = [1]; //~ ERROR mismatched types

    let x = (1, &mut 2);
    (a, b) = x; //~ ERROR mismatched types

    S { a, b } = S { a: 1, b: &mut 2 }; //~ ERROR mismatched types
}