Files
rust/tests/ui/suggestions
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-04-03 21:41:58 +00:00
2024-02-07 10:42:01 +08:00
2024-02-04 11:34:10 +08:00
2025-08-26 14:46:11 +02:00
2025-07-13 13:50:01 +00:00
2024-02-07 10:42:01 +08:00
2024-03-13 23:05:17 +00:00
2025-06-26 03:43:01 +00:00
2023-11-20 23:44:37 +00:00
2025-06-03 10:52:32 -07:00