Matthias Krüger
8de487fdbd
Rollup merge of #124599 - estebank:issue-41708, r=wesleywiser
...
Suggest borrowing on fn argument that is `impl AsRef`
When encountering a move conflict, on an expression that is `!Copy` passed as an argument to an `fn` that is `impl AsRef`, suggest borrowing the expression.
```
error[E0382]: use of moved value: `bar`
--> f204.rs:14:15
|
12 | let bar = Bar;
| --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait
13 | foo(bar);
| --- value moved here
14 | let baa = bar;
| ^^^ value used here after move
|
help: borrow the value to avoid moving it
|
13 | foo(&bar);
| +
```
Fix #41708
2024-07-11 17:01:36 +02:00
..
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-12-07 23:00:46 -05:00
2024-04-24 22:21:15 +00:00
2024-04-24 22:21:15 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-04-24 22:21:15 +00:00
2024-04-24 22:21:15 +00:00
2024-04-24 22:21:15 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-24 22:21:15 +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
2024-04-15 21:45:47 -04:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-04-15 21:36:52 -04:00
2024-04-24 22:21:15 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-05-09 23:25:31 +00:00
2024-05-09 23:25:31 +00:00
2024-05-09 23:25:31 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-04-12 04:46:31 +00:00
2024-04-12 04:46:31 +00:00
2024-03-06 12:35:07 -08:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-04-11 16:41:41 +00:00
2024-04-24 22:21:15 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-04-11 16:41:41 +00:00
2024-04-11 16:41:41 +00:00
2024-04-11 16:41:41 +00:00
2024-03-17 21:32:26 +00:00
2024-06-20 04:25:17 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-03-17 21:45:03 +00:00
2024-03-17 21:45:03 +00:00
2024-04-11 16:41:40 +00:00
2024-02-16 20:02:50 +00:00
2024-04-11 16:41:40 +00:00
2024-04-11 16:41:41 +00:00
2024-02-16 20:02:50 +00:00
2024-04-11 16:41:41 +00:00
2023-11-24 19:15:52 +01:00
2024-04-24 22:21:15 +00:00
2024-04-24 22:21:15 +00:00
2024-04-24 22:21:15 +00:00