Files
rust/tests/ui/nll
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-09-28 20:55:35 +00:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2024-03-23 16:14:42 +01:00
2023-05-08 17:58:01 -03:00
2023-05-08 17:58:01 -03:00
2023-05-08 17:58:01 -03:00
2024-04-07 17:38:07 -03:00
2024-04-07 17:38:07 -03:00
2024-04-07 17:38:07 -03:00
2024-04-07 17:38:07 -03:00
2024-04-07 17:38:07 -03:00
2024-04-07 17:38:07 -03:00
2023-05-08 17:58:01 -03:00
2023-05-08 17:58:01 -03:00
2023-05-08 17:58:01 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-02-16 11:42:35 -03:00
2024-04-03 21:02:47 +02:00
2024-04-03 21:02:47 +02:00
2024-04-03 23:16:27 +02:00