rust/tests/ui/error-codes/E0504.rs
2023-01-11 09:32:08 +00:00

16 lines
282 B
Rust

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);
}