15 Commits

Author SHA1 Message Date
Esteban Küber
2df4f7dd8c 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-05-09 23:25:31 +00:00
Tshepang Mbambo
0457eda673
doc: replace wrong punctuation mark 2023-07-28 14:46:17 +02:00
Deadbeef
76dbe29104 rm const traits in libcore 2023-04-16 06:49:27 +00:00
Keith T. Star
c3329ba63a Minor grammar nit. 2022-12-12 16:22:01 -07:00
Deadbeef
be65e03676 Add const_traits 2022-09-16 11:48:42 +08:00
Cameron Steffen
17ddcb434b Improve primitive/std docs separation and headers 2022-08-20 16:50:29 -05:00
woppopo
8f68bdc380 Make Borrow and BorrowMut impls const 2021-12-04 21:57:39 +09:00
Ryan Levick
1999a3147f Fix borrow and deref 2021-03-03 11:23:29 +01:00
Ryan Levick
da3995f0ec Remove lint pass on borrow and deref 2021-03-03 11:23:14 +01:00
Ryan Levick
a6d926d80d Fix tests 2021-03-03 11:22:44 +01:00
Ryan Levick
f49ed7a6b7 Add tests and support two more noop methods 2021-03-03 11:22:17 +01:00
Camelid
0506789014 Remove many unnecessary manual link resolves from library
Now that #76934 has merged, we can remove a lot of these! E.g, this is
no longer necessary:

    [`Vec<T>`]: Vec
2020-12-31 11:54:32 -08:00
Denis Vasilik
d7e7271085 Remove AsRef link as it is in the prelude 2020-08-10 20:29:20 +02:00
Denis Vasilik
7dba693f0e Use intra-doc links 2020-08-09 23:06:44 +02:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00