Esteban Küber
4ab1fc5127
Provide more context on Fn closure modifying binding
...
When modifying a binding from inside of an `Fn` closure, point at the binding definition and suggest using an `std::sync` type that would allow the code to compile.
```
error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
--> f703.rs:6:9
|
4 | let mut counter = 0;
| ----------- `counter` declared here, outside the closure
5 | let x: Box<dyn Fn()> = Box::new(|| {
| -- in this closure
6 | counter += 1;
| ^^^^^^^^^^^^ cannot assign
```
2025-11-03 20:26:18 +00:00
..
2025-10-11 20:50:21 +00:00
2025-06-11 15:30:15 +01:00
2025-01-27 02:28:04 +01:00
2025-10-07 09:51:16 +01:00
2025-05-05 14:27:09 +00:00
2024-08-28 12:54:39 +08:00
2024-08-28 12:54:39 +08:00
2025-08-04 16:43:53 -04:00
2025-11-03 20:26:18 +00:00
2025-06-30 11:50:19 +05:00
2025-08-05 19:34:46 +05:00
2024-12-07 21:37:13 +00:00
2024-12-07 21:37:13 +00:00
2025-07-01 16:26:57 +05:00
2025-07-01 15:16:56 +05:00
2025-07-01 15:16:56 +05:00
2025-06-04 17:48:50 +05:00
2025-06-04 17:48:50 +05:00
2024-07-04 05:36:34 +00:00
2025-07-01 16:26:57 +05:00
2024-10-29 16:26:57 +00:00
2025-08-27 00:23:26 -04:00
2025-07-05 01:25:48 +05:00
2025-07-05 01:25:48 +05:00
2024-07-22 21:51:44 -04:00
2024-09-26 19:26:08 +02:00
2025-05-09 15:31:27 +00:00
2024-10-29 16:26:57 +00:00
2025-08-10 11:54:15 -04:00
2025-07-01 16:26:57 +05:00
2024-11-04 23:27:45 +01:00
2024-11-02 03:42:10 +00:00
2024-11-02 03:42:10 +00:00
2025-02-21 19:32:45 +00:00
2025-01-23 20:51:29 +08:00
2025-02-14 19:18:43 +00:00
2025-07-05 00:50:51 +05:00
2025-07-05 00:50:51 +05:00
2025-07-31 21:25:49 +05:00
2025-07-31 21:25:49 +05:00
2025-09-12 14:45:12 -04:00
2025-09-12 14:45:12 -04:00
2025-10-01 12:38:16 +00:00
2025-10-01 12:38:16 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2025-08-19 21:27:10 +02:00
2024-11-26 02:50:48 +08:00
2025-08-22 13:16:44 +08:00
2025-08-22 13:16:44 +08:00
2024-12-07 21:26:20 +00:00
2024-07-12 21:16:09 -04:00
2025-04-09 10:42:26 +00:00
2025-08-26 15:15:17 -06:00
2025-08-26 15:15:17 -06:00
2025-06-22 10:58:25 +02:00
2025-10-11 21:59:51 -04:00
2025-10-11 21:59:51 -04:00
2024-12-13 00:04:56 +00:00
2024-12-13 00:04:56 +00:00
2025-07-01 15:29:29 +05:00
2025-06-30 20:36:16 +02:00
2025-06-30 20:36:16 +02:00
2025-10-11 20:50:21 +00:00
2025-10-11 20:50:21 +00:00
2025-02-10 20:21:39 +00:00
2025-07-10 18:50:35 +05:00
2025-08-19 21:27:10 +02:00
2025-05-05 19:06:45 +00:00
2025-02-02 01:00:33 +00:00
2025-02-02 01:00:33 +00:00
2025-01-28 14:11:29 +00:00
2025-08-09 16:27:20 +05:00
2025-08-19 21:27:10 +02:00
2025-03-26 02:25:01 +01:00
2025-04-08 23:06:31 +03:00
2025-11-03 20:26:18 +00:00