summaryrefslogtreecommitdiffstats
path: root/tests/ui/chalkify/closure.rs
blob: a908a1e97ecd9c3491a7ddcd70ef3a2b73cff2c8 (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
28
29
30
31
32
33
34
35
36
37
38
// compile-flags: -Z trait-solver=chalk

fn main() -> () {
    let t = || {};
    t();

    let mut a = 0;
    let mut b = move || {
        a = 1;
    };
    b();

    let mut c = b;

    c();
    b();

    let mut a = 0;
    let mut b = || {
        a = 1;
    };
    b();

    let mut c = b;

    c();
    b(); //~ ERROR

    // FIXME(chalk): this doesn't quite work
    /*
    let b = |c| {
        c
    };

    let a = &32;
    b(a);
    */
}