You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let tmp = iflet(Ok(_src_path),Ok(_dest_path)) =
(Path::new(&src_path).strip_prefix(&cur_dir),Path::new(&dest_path).strip_prefix(&cur_dir)){(_src_path.to_path_buf(), _dest_path.to_path_buf())}else{(src_path, dest_path)};
I get the following error:
error[E0505]: cannot move out of `src_path` because it is borrowed
--> src/libsyntax/parse/parser.rs:5249:30
|
5245 | (Path::new(&src_path).strip_prefix(&cur_dir),
| -------- borrow of `src_path` occurs here
...
5249 | (src_path, dest_path)
| ^^^^^^^^ move out of `src_path` occurs here
error[E0505]: cannot move out of `dest_path` because it is borrowed
--> src/libsyntax/parse/parser.rs:5249:40
|
5246 | Path::new(&dest_path).strip_prefix(&cur_dir)) {
| --------- borrow of `dest_path` occurs here
...
5249 | (src_path, dest_path)
| ^^^^^^^^^ move out of `dest_path` occurs here
error: aborting due to 2 previous errors
However, since we're out of the if scope, shouldn't I be able to use src_path and dest_path again?
Activity
vitalyd commentedon Feb 17, 2017
You're hitting lexical borrow issue - rust-lang/rfcs#811.
Auto merge of #59114 - matthewjasper:enable-migate-2015, r=<try>
Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix