Commit graph

18 commits

Author SHA1 Message Date
Matthew Kraai
2f43313834 Convert collapsed to shortcut reference links 2019-12-26 05:27:55 -08:00
David Tolnay
95e00bfed8
Format libcore with rustfmt
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in `outstanding_files`, the
relevant commands were:

    $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
    $ rg libcore outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libcore.
2019-11-26 23:02:11 -08:00
Esteban Küber
f57413b717 Suggest borrowing when it would satisfy an unmet trait bound
When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.
2019-11-16 13:23:19 -08:00
Christian
55f8dde6c8 Added an extra line to make the formatting conform to the rest of the document. 2019-08-24 13:38:09 +02:00
Christian
a577316b0a Removed the confusing FnOnce example. closes #47091 2019-08-24 13:36:57 +02:00
Esteban Küber
3ab60264b5 Add note suggesting to borrow a String argument to find 2019-07-25 10:11:03 -07:00
Taiki Endo
1d05f81d19 Add #[must_use] message to Fn* traits 2019-02-07 19:44:06 +09:00
Corey Farwell
d2c91a1a6d Fix broken links to second edition TRPL.
Fixes https://github.com/rust-lang/rust/issues/57104.
2019-01-01 12:53:07 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Felix Chapman
ecc4ca54a4 Add #[must_use] attribute to stdlib traits 2018-12-10 14:45:26 +00:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
Scott McMurray
0a3bd9b6ab Use impl_header_lifetime_elision in libcore 2018-09-29 21:33:35 -07:00
Esteban Küber
e5e14d307b When closure with no arguments was expected, suggest wrapping 2018-08-15 13:05:01 -07:00
bors
f774bced50 Auto merge of #43724 - lukaramu:std-ops-docs, r=QuietMisdreavus
Improve std::ops docs

Fixes #29365. (This fixes all but one point from @steveklabnik's list, but that point was referring to examples of implementing range traits, but there are no range traits in std::ops.)

The main changes are quite a bit of copyediting, adding more "real" examples for some of the traits, incorporating some guidance from the API docs, more linking (cross-docs and to the book & reference), cleaning up examples, moving things around, and so on. Refer to the commit messages for more details.

Note: I decided to link to the second edition of the book since I think it's more appropriate now for the sections I linked, if this is not okay, please say so!
2017-08-12 19:40:49 +00:00
lukaramu
6bdba82ba1 std::ops docs: incorporated changes suggested in review
* fixed link typos and copy-paster errors
* rewrote Fn* explanations
* `RHS = Self` -> `RHS` is `Self` (added that to all applicable places as
  well)
* fixed up some links
* s/MutDeref/DerefMut
* removed remaining superfluous `fn main()`s
* fixed some minor phrasings and factual errors and inaccuracies

std::ops docs: Fix phrasing and factual errors/inaccuracies
2017-08-12 19:53:04 +02:00
lukaramu
5414c85689 Revise Fn/FnMut/FnOnce documentation
Part of #29365.
* Moved explanations out of Examples section and expanded on them.
* Made the super-/subtrait relationships more explicit.
* Added links to the other traits, TRPL and the nomicon where appropriate
* Changed method summaries to be in 3rd person singular
* General copyediting
2017-08-07 23:10:16 +02:00
Isaac van Bakel
400075d9d9 Fixed all unnecessary muts in language core 2017-08-01 23:01:24 +01:00
Clar Charr
b9c8e99955 Move Fn to module. 2017-06-09 19:07:25 -04:00