summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-codes/E0504.rs
blob: c2658bef619757f623bfaa07c1c2d02169126ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct FancyNum {
    num: u8,
}

fn main() {
    let fancy_num = FancyNum { num: 5 };
    let fancy_ref = &fancy_num;

    let x = move || { //~ ERROR E0505
        println!("child function: {}", fancy_num.num);
    };

    x();
    println!("main function: {}", fancy_ref.num);
}