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
#[clone_on_capture(debug)]fntest_add(){let a = "a".to_string();let closure = move || {format!("{a}");};format!("{a}");}
Compile error:
error[E0382]: borrow of moved value: `a`
--> tests/integration_tests.rs:10:14
|
6 |let a = "a".to_string();| - move occurs because `a` has type`String`, which does not implement the `Copy` trait
7 |let closure = move || {
| ------- value moved into closure here
8 | format!("{a}");| - variable moved due to use in closure
9 | };
10 | format!("{a}");| ^^^ value borrowed here after move
Compile error:
Macro token stream:
The text was updated successfully, but these errors were encountered: