fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0505]: cannot move out of `fancy_num` because it is borrowed 2 --> $DIR/E0504.rs:9:13 3 | 4LL | let fancy_num = FancyNum { num: 5 }; 5 | --------- binding `fancy_num` declared here 6LL | let fancy_ref = &fancy_num; 7 | ---------- borrow of `fancy_num` occurs here 8LL | 9LL | let x = move || { 10 | ^^^^^^^ move out of `fancy_num` occurs here 11LL | println!("child function: {}", fancy_num.num); 12 | ------------- move occurs due to use in closure 13... 14LL | println!("main function: {}", fancy_ref.num); 15 | ------------- borrow later used here 16 17error: aborting due to previous error 18 19For more information about this error, try `rustc --explain E0505`.