summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/print/closure-print-generic-verbose-1.rs
blob: 67d37f1c59b40d36f2ca087aed5a1112c3df9835 (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
// compile-flags: -Zverbose

fn to_fn_once<F:FnOnce()>(f: F) -> F { f }

fn f<T: std::fmt::Display>(y: T) {
    struct Foo<U: std::fmt::Display> {
        x: U
    };

    let foo =  Foo{ x: "x" };

    let c = to_fn_once(move|| {
        println!("{} {}", foo.x, y);
    });

    c();
    c();
    //~^ ERROR use of moved value
}


fn main() {
    f("S");
}