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-11-02 20:12:26 +00:00
2025-11-02 20:12:26 +00:00
2025-11-02 20:12:26 +00:00
2025-06-27 17:03:48 +02:00
2025-11-09 22:14:48 +00:00
2025-05-23 12:20:35 +00:00
2025-05-23 12:20:35 +00:00
2025-06-13 18:10:06 +02:00
2025-04-08 23:06:31 +03:00
2025-10-18 01:20:25 +00:00
2025-06-02 15:37:15 +00:00
2025-06-07 13:42:30 +02:00
2025-04-06 21:41:47 +02:00
2025-04-06 21:41:47 +02:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-07-09 17:07:04 +00:00
2025-09-29 03:28:52 +00:00
2025-03-12 16:56:26 +00:00
2025-04-13 21:48:53 +03:00
2025-04-13 21:48:53 +03:00
2025-06-13 01:16:36 +02:00
2025-06-13 01:16:36 +02:00
2025-03-14 19:50:03 +00:00
2025-04-08 23:06:31 +03:00
2025-05-07 18:12:54 +00:00
2025-05-07 18:12:54 +00:00
2025-08-11 16:58:21 -05:00
2025-05-06 17:04:03 +02:00
2025-04-08 23:06:31 +03:00
2025-06-24 18:59:42 +00:00
2025-04-08 23:06:31 +03:00
2025-08-07 21:18:00 +00:00
2025-08-07 21:18:00 +00:00
2025-03-15 10:52:07 -06:00
2025-03-15 10:52:07 -06:00
2025-11-09 22:14:48 +00:00
2025-11-03 16:24:36 +00:00
2025-07-31 13:55:59 +08:00
2025-07-03 23:47:19 +08:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-08-27 20:25:18 +02:00
2025-08-27 20:25:18 +02:00
2025-03-04 00:21:02 +08:00
2025-03-04 00:21:02 +08:00
2025-06-27 17:03:48 +02:00
2025-02-27 12:22:59 +01:00
2025-02-27 12:22:59 +01:00
2025-04-08 23:06:31 +03:00
2025-03-04 00:21:02 +08:00
2025-06-17 23:22:51 +02:00
2025-06-17 23:22:51 +02:00
2025-06-17 23:22:51 +02:00
2025-08-11 17:02:32 +00:00
2025-08-11 16:00:49 +00:00
2025-03-06 12:53:35 +01:00
2025-11-09 22:14:48 +00:00
2025-04-08 23:06:31 +03:00
2025-04-13 21:48:53 +03:00
2025-06-06 20:52:34 +00:00
2025-04-08 23:06:31 +03:00
2025-02-25 16:56:04 +00:00
2025-06-06 20:52:34 +00:00
2025-07-01 19:58:27 +08:00
2025-06-02 11:02:50 +02:00
2025-06-02 11:02:50 +02:00
2025-05-28 15:14:34 +01:00
2025-05-28 15:14:34 +01:00
2025-06-03 10:13:33 +02:00
2025-06-03 10:13:33 +02:00
2025-08-14 18:18:42 +02:00
2025-09-18 09:16:58 -04:00
2025-09-18 09:16:58 -04:00
2025-02-28 20:43:15 +00:00
2025-07-13 13:50:01 +00:00
2025-08-07 21:39:00 +00:00