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-10-11 20:50:21 +00:00
2025-08-26 15:15:17 -06:00
2025-11-09 22:14:48 +00:00
2025-11-09 22:14:48 +00:00
2025-08-25 15:16:25 +00:00
2025-10-02 05:45:16 -06:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-09-03 15:24:49 +02:00
2025-09-03 15:24:49 +02:00
2025-07-04 23:47:31 -07:00
2025-07-04 23:47:31 -07:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-03-14 14:51:58 +08:00
2025-03-14 14:51:58 +08:00
2025-02-17 09:30:40 +11:00
2025-11-06 09:41:16 +08:00
2025-11-06 09:41:16 +08:00
2025-05-03 17:22:52 +02:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-02-10 20:21:39 +00:00
2025-06-03 13:35:31 +02:00
2025-06-03 13:35:31 +02:00
2025-07-10 23:39:54 +08:00
2025-11-09 22:14:48 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-08-26 15:15:17 -06:00
2025-06-03 13:35:31 +02:00
2025-11-09 22:14:48 +00:00
2025-11-09 22:14:48 +00:00
2025-04-08 00:34:40 +02:00
2025-04-08 00:34:40 +02:00
2025-04-08 00:34:40 +02:00
2025-04-08 00:34:40 +02:00
2025-05-08 15:00:17 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-04-08 23:06:31 +03:00
2025-04-08 23:06:31 +03:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-06-03 07:38:06 +05:00
2025-06-03 07:38:06 +05:00
2025-06-03 07:38:06 +05:00
2025-10-18 01:20:25 +00:00
2025-07-25 20:38:54 +05:00
2025-02-10 20:21:39 +00:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-04-03 21:41:58 +00:00
2025-08-19 21:27:10 +02:00
2025-06-11 15:30:15 +01:00
2025-08-09 16:27:20 +05:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00: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-09 16:27:20 +05:00
2025-08-05 19:34:46 +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
2025-04-08 21:05:20 +00:00
2025-04-08 21:05:20 +00:00
2025-08-02 15:29:16 -04:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-08-10 11:54:15 -04:00
2025-08-10 11:54:15 -04:00
2025-05-22 12:52:46 +01:00