Files
rust/tests/ui/pattern
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-05-03 17:22:52 +02:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-09 16:27:20 +05:00
2024-02-09 15:43:08 -03:00
2024-02-09 15:43:08 -03:00
2024-04-29 14:53:38 +02:00
2024-03-27 11:20:28 -04:00
2025-08-09 16:27:20 +05:00
2024-01-13 12:46:58 -05:00
2024-11-21 18:40:36 +08:00
2024-11-21 18:40:36 +08:00
2025-06-11 15:30:15 +01:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-09 16:27:20 +05:00