Files
rust/src/libcore
kennytm f32f810e6e Rollup merge of #46518 - partim:asref-borrow-doc, r=dtolnay
Improve documentation for Borrow

This is the first step in improving the documentation for all the reference conversion traits. It proposes new text for the trait documentation of `Borrow`. Since I feel it is a somewhat radical rewrite and includes a stricter contract for `Borrow` then the previous text—namely that *all* shared traits need to behave the same, not just a select few—, I wanted to get some feedback before continuing.

Apart from the ‘normative’ description, the new text also includes a fairly extensive explanation of how the trait is used in the examples section. I included it because every time I look at how `HashMap` uses the trait, I need to think for a while as the use is a bit twisted. So, I thought having this thinking written down as part of the trait itself might be useful. One could argue that this should go into The Book, and, while I really like having everything important in the docs, I can see the text moved there, too.

So, before I move on: is this new text any good? Do we feel it is correct, useful, comprehensive, and understandable?

(This PR is in response to #44868 and #24140.)
2018-03-20 07:15:12 +08:00
..
2018-02-20 08:52:33 -07:00
2018-01-30 05:31:38 -07:00
2018-03-06 16:33:38 -05:00
2018-03-18 13:05:00 +01:00
2018-03-11 10:59:28 -07:00
2017-08-31 06:58:58 -07:00
2018-03-14 12:44:51 +08:00
2017-09-21 15:46:17 -04:00
2018-02-28 18:23:54 +00:00
2018-03-06 14:40:26 -08:00
2018-03-02 19:20:36 -05:00
2017-03-20 10:10:16 -04:00
2018-02-10 21:20:42 +00:00
2017-08-31 06:58:58 -07:00
2017-10-18 23:12:37 -07:00