Esteban Küber
cc80106cb5
Provide more suggestions for cloning immutable bindings
...
When encountering multiple mutable borrows, suggest cloning and adding
derive annotations as needed.
```
error[E0596]: cannot borrow `sm.x` as mutable, as it is behind a `&` reference
--> $DIR/accidentally-cloning-ref-borrow-error.rs:32:9
|
LL | foo(&mut sm.x);
| ^^^^^^^^^ `sm` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: `Str` doesn't implement `Clone`, so this call clones the reference `&Str`
--> $DIR/accidentally-cloning-ref-borrow-error.rs:31:21
|
LL | let mut sm = sr.clone();
| ^^^^^^^
help: consider annotating `Str` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Str {
|
help: consider specifying this binding's type
|
LL | let mut sm: &mut Str = sr.clone();
| ++++++++++
```
```
error[E0596]: cannot borrow `*inner` as mutable, as it is behind a `&` reference
--> $DIR/issue-91206.rs:14:5
|
LL | inner.clear();
| ^^^^^ `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: you can `clone` the `Vec<usize>` value and consume it, but this might not be your desired behavior
--> $DIR/issue-91206.rs:11:17
|
LL | let inner = client.get_inner_ref();
| ^^^^^^^^^^^^^^^^^^^^^^
help: consider specifying this binding's type
|
LL | let inner: &mut Vec<usize> = client.get_inner_ref();
| +++++++++++++++++
```
2023-12-04 21:54:34 +00:00
..
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:34 +00:00
2023-12-04 21:54:34 +00:00
2023-11-24 19:15:52 +01:00
2023-09-23 13:47:30 +00:00
2023-04-21 22:32:38 +00:00
2023-11-24 19:15:52 +01:00
2023-05-05 22:40:04 +12:00
2023-07-10 20:09:26 +00:00
2023-05-05 22:40:04 +12:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-07-10 20:09:26 +00:00
2023-01-15 19:46:20 +00:00
2023-05-05 22:40:05 +12:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-17 02:45:11 +00:00
2023-04-17 09:16:07 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-05 22:40:05 +12:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-05-21 14:16:41 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-21 13:37:32 +02:00
2023-01-17 02:47:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-05 22:40:04 +12:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-12-04 21:54:32 +00:00
2023-12-04 21:54:32 +00:00
2023-12-04 21:54:32 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-03 09:24:11 +02:00
2023-11-24 19:15:52 +01:00
2023-05-05 22:40:05 +12:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-05-21 13:37:32 +02:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-25 17:40:46 +00:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:32 +00:00
2023-07-10 20:09:28 +00:00
2023-12-04 21:54:32 +00:00
2023-07-14 07:12:38 +08:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-03-05 16:56:57 +01:00
2023-11-24 19:15:52 +01:00
2023-11-20 23:13:36 +03:00
2023-11-20 23:13:36 +03:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-25 17:40:46 +00:00
2023-05-25 17:40:46 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-20 15:06:17 -03:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-03-03 16:33:11 +01:00
2023-11-24 19:15:52 +01:00
2023-10-24 15:30:17 +00:00
2023-11-24 19:15:52 +01:00
2023-09-07 00:20:38 +08:00
2023-09-07 00:20:38 +08:00
2023-11-24 19:15:52 +01:00
2023-09-07 00:20:38 +08:00
2023-09-07 00:20:38 +08:00
2023-09-07 00:20:38 +08:00
2023-03-16 11:21:50 +01:00
2023-11-24 19:15:52 +01:00
2023-03-05 16:56:57 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:32 +00:00
2023-12-04 21:54:32 +00:00
2023-12-04 21:54:32 +00:00
2023-02-16 11:42:35 -03:00
2023-02-16 11:42:35 -03:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:34 +00:00
2023-12-04 21:54:34 +00:00
2023-12-04 21:54:34 +00:00
2023-12-04 21:54:34 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:34 +00:00
2023-12-04 21:54:34 +00:00
2023-11-24 19:15:52 +01:00
2023-09-19 18:15:23 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-02-02 16:26:01 +00:00
2023-02-02 16:26:01 +00:00
2023-09-21 22:20:58 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-02-22 08:40:47 -07:00
2023-02-22 08:40:47 -07:00
2023-04-19 19:13:35 +00:00
2023-04-19 19:13:35 +00:00
2023-07-10 20:09:26 +00:00
2023-05-29 13:11:03 +08:00
2023-05-29 13:11:03 +08:00
2023-08-23 12:35:00 +08:00
2023-11-28 17:12:20 -08:00
2023-09-07 00:20:38 +08:00
2023-09-07 00:20:38 +08:00
2023-11-24 19:15:52 +01:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-15 16:11:42 -07:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-07-10 20:09:26 +00:00
2023-05-05 22:40:05 +12:00
2023-11-24 19:15:52 +01:00
2023-10-05 01:04:41 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-04 21:54:32 +00:00
2023-07-10 20:09:26 +00:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-04-25 20:41:59 +00:00
2023-04-25 20:41:59 +00:00
2023-08-23 21:46:18 +00:00
2023-08-23 21:46:18 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-30 23:57:47 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-15 19:46:20 +00:00
2023-11-24 19:15:52 +01:00
2023-07-10 20:09:26 +00:00
2023-08-04 13:17:39 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-12 13:51:16 +01:00
2023-12-04 21:54:32 +00:00
2023-12-04 21:54:32 +00:00