Files
rust/tests/ui/consts
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-11-02 20:12:26 +00:00
2025-11-02 20:12:26 +00:00
2025-11-02 20:12:26 +00:00
2025-10-03 13:30:47 -04:00
2024-01-13 12:46:58 -05:00
2024-09-15 09:51:32 +02:00
2024-08-18 19:46:53 +02:00
2023-01-11 09:32:08 +00:00
2025-11-02 20:12:26 +00:00
2024-11-22 02:32:26 +00:00
2025-02-27 20:02:25 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-11-22 02:32:26 +00:00
2024-11-22 02:32:26 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-21 12:49:45 +03:00
2023-01-11 09:32:08 +00:00
2023-11-12 04:33:19 +00:00
2025-09-12 12:39:31 +03:00
2024-02-25 12:03:48 +01:00
2025-11-02 20:12:26 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-04-16 11:38:52 +00:00
2023-07-27 15:51:02 +00:00
2025-11-02 20:12:26 +00:00
2023-01-11 09:32:08 +00:00
2025-11-02 20:12:26 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-07-13 13:50:01 +00:00
2023-07-27 15:51:02 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-12-25 10:36:32 +01:00
2025-07-21 09:11:21 +00:00
2025-07-21 09:11:21 +00:00
2023-01-11 09:32:08 +00:00
2024-10-07 16:29:52 +00:00
2025-11-02 20:12:26 +00:00
2025-08-05 19:34:46 +05:00
2024-09-15 09:51:32 +02:00
2025-02-23 23:11:00 +07:00
2025-09-12 14:45:12 -04:00
2023-01-11 09:32:08 +00:00
2023-01-15 19:46:20 +00:00
2025-06-13 09:20:48 +02:00
2025-06-13 09:20:48 +02:00
2024-11-16 22:50:22 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2025-01-06 17:54:59 +01:00
2025-01-06 17:54:59 +01:00
2025-10-30 08:05:37 +00:00
2024-09-14 18:07:06 +02:00