Files
rust/tests/ui/issues
Esteban Küber 71b0755a98 Provide more context when mutably borrowing an imutable borrow
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
```
2025-11-09 22:14:48 +00:00
..
2025-04-03 21:41:58 +00:00
2025-06-06 20:52:34 +00:00
2025-02-04 10:57:49 +00:00
2025-02-03 19:00:22 +00:00
2025-10-11 20:50:21 +00:00
2024-01-13 12:46:58 -05:00
2024-07-06 14:24:20 +02:00
2023-05-01 16:15:13 +08:00
2025-08-26 14:46:11 +02:00
2023-04-08 21:32:55 +00:00
2025-10-01 07:39:03 +00:00
2024-01-05 10:00:59 +00:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-22 08:58:45 +02:00
2023-11-16 17:00:23 +00:00
2024-04-29 14:53:38 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2025-08-22 13:16:44 +08:00
2025-08-22 13:16:44 +08:00
2024-11-22 02:32:26 +00:00
2023-06-26 08:56:32 +00:00