mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
16 lines
282 B
Rust
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);
|
|
}
|