Files
rust/tests/ui/closures
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-06-11 15:30:15 +01:00
2025-06-30 11:50:19 +05:00
2025-08-05 19:34:46 +05:00
2025-07-01 16:26:57 +05:00
2025-08-27 00:23:26 -04:00
2025-07-31 21:25:49 +05:00
2025-07-31 21:25:49 +05:00
2025-08-22 13:16:44 +08:00
2025-08-22 13:16:44 +08:00
2025-04-09 10:42:26 +00: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-08-09 16:27:20 +05:00