Esteban Küber
904652b2d0
Suggest cloning Arc moved into closure
...
```
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-capture-clause-bad.rs:9:20
|
LL | let x = "Hello world!".to_string();
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
LL | thread::spawn(move || {
| ------- value moved into closure here
LL | println!("{}", x);
| - variable moved due to use in closure
LL | });
LL | println!("{}", x);
| ^ value borrowed here after move
|
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider cloning the value before moving it into the closure
|
LL ~ let value = x.clone();
LL ~ thread::spawn(move || {
LL ~ println!("{}", value);
|
```
2025-06-24 18:44:41 +00:00
..
2025-02-15 21:49:53 +00:00
2025-02-01 14:39:43 -07:00
2025-02-10 20:21:39 +00:00
2025-01-18 22:09:35 +00:00
2025-04-19 18:42:24 +08:00
2025-04-19 18:42:24 +08:00
2025-02-20 03:37:19 +00:00
2025-02-20 03:37:19 +00:00
2025-06-18 10:20:43 +02:00
2025-06-18 10:20:43 +02:00
2025-06-18 10:20:43 +02:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-04-08 23:06:31 +03:00
2025-01-23 20:51:29 +08:00
2025-06-24 18:44:41 +00:00
2025-06-24 18:44:41 +00:00
2025-06-18 10:20:43 +02:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-02-21 00:41:17 +00:00
2025-02-04 10:57:49 +00:00
2025-04-26 14:48:30 +09:00
2025-04-26 14:48:30 +09:00
2025-04-08 23:06:31 +03:00
2025-06-18 10:20:43 +02:00
2025-06-18 10:20:43 +02:00
2025-06-04 10:40:04 -04:00
2025-06-04 10:40:04 -04:00
2025-01-06 16:08:29 -08:00
2025-04-06 21:41:47 +02:00
2025-01-06 16:08:29 -08:00
2025-02-11 19:24:07 +00:00
2025-02-11 19:24:07 +00:00
2025-02-10 20:21:39 +00:00
2025-01-06 16:08:29 -08:00
2025-01-06 16:08:29 -08:00
2025-06-18 10:20:43 +02:00
2025-01-23 20:51:29 +08:00
2025-04-08 23:06:31 +03:00
2025-04-08 23:06:31 +03:00
2025-06-18 10:20:43 +02:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-06-02 15:37:15 +00:00
2025-06-07 13:42:30 +02:00
2025-06-06 21:27:37 -04:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:41:17 +00:00
2025-06-02 15:37:15 +00:00
2025-06-07 13:42:30 +02:00
2025-06-02 15:37:15 +00:00
2025-06-07 13:42:30 +02:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-01-28 19:35:51 +00:00
2025-01-28 19:35:51 +00:00
2025-01-28 14:11:29 +00:00
2025-02-14 00:44:10 -08:00
2025-04-17 19:45:28 +08:00
2025-03-13 18:03:26 +01:00
2025-03-30 01:32:21 +03:00
2025-02-10 20:21:39 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-05-07 18:12:54 +00:00
2025-05-07 18:12:54 +00:00
2025-06-05 20:03:29 +05:00
2025-06-05 20:03:29 +05:00
2025-06-16 19:58:01 +02:00
2025-06-16 19:58:01 +02:00
2025-06-16 19:58:01 +02:00
2025-04-22 12:07:53 +02:00
2025-06-18 10:20:43 +02:00
2025-02-10 20:21:39 +00:00
2025-04-06 21:41:47 +02:00
2025-04-08 23:06:31 +03:00
2025-01-06 16:08:29 -08:00
2025-04-14 10:00:28 +00:00
2025-04-14 10:00:28 +00:00
2025-04-14 10:00:28 +00:00
2025-04-14 10:00:28 +00:00
2025-02-10 20:21:39 +00:00
2025-04-21 16:16:38 +09:00
2025-04-21 16:16:38 +09:00