Files
rust/tests/ui/closures
Stuart Cook 417bea36ef Rollup merge of #148508 - estebank:issue-74617, r=nnethercote
Provide more context when mutably borrowing an imutably borrowed value

Point at statics and consts being mutable borrowed or written to:

```
error[E0594]: cannot assign to immutable static item `NUM`
  --> $DIR/E0594.rs:4:5
   |
LL | static NUM: i32 = 18;
   | --------------- this `static` cannot be written to
...
LL |     NUM = 20;
   |     ^^^^^^^^ cannot assign
```

Point at the expression that couldn't be mutably borrowed from a pattern:

```
error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/mut-pattern-of-immutable-borrow.rs:19:14
   |
LL |     match &arg.field {
   |           ---------- this cannot be borrowed as mutable
LL |         Some(ref mut s) => s.push('a'),
   |              ^^^^^^^^^ cannot borrow as mutable
```

Partially address rust-lang/rust#74617.
2025-11-11 21:09:38 +11: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
2023-06-20 19:46:01 -04: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
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-08-28 17:47:37 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-10-20 21:14:01 +00: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