about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2017-11-22Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomezbors-0/+40
rustdoc: include external files in documentation (RFC 1990) Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR) cc #44732 Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-22Stabilize spin_loop_hintStjepan Glavina-4/+4
2017-11-21allow loading external files in documentationQuietMisdreavus-0/+40
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-21fix some typosMartin Lindhe-5/+5
2017-11-21Auto merge of #45039 - QuietMisdreavus:doc-spotlight, ↵bors-0/+30
r=GuillaumeGomez,QuietMisdreavus show in docs whether the return type of a function impls Iterator/Read/Write Closes #25928 This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired. ### Known shortcomings ~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.) The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful: <details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png) </details> All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`: <details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png) </details>
2017-11-20Update books for next releasesteveklabnik-0/+0
Also includes a fix in std::ops
2017-11-18Rollup merge of #45767 - QuietMisdreavus:who-docs-the-doc-tool, r=frewsxcvGuillaume Gomez-6/+28
rustdoc book: talk about #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))] While investigating https://github.com/rust-lang/rust/issues/45750 i noticed that `#![doc(test(attr(...)))]` wasn't documented at all. Since this is useful for making your examples follow the same coding guidelines as your code, i wanted to add it to the Rustdoc Book. I also added `#![doc(test(no_crate_inject))]` since it's used in the same place and might be useful for macro-heavy crates. I added mentions for these to "The `doc` attribute" as well as "Documentation tests" since it's useful information in both places. Technically the step reordering in the second commit is gated on https://github.com/rust-lang/rust/pull/45764, since before that lands attributes from the doctest come before the ones from `#![doc(test(attr(...)))]`.
2017-11-17update links and tracking issue for doc_spotlightQuietMisdreavus-2/+5
2017-11-17add doc_highlight feature flag and testsQuietMisdreavus-0/+27
2017-11-16Auto merge of #45692 - steveklabnik:ship-cargo-book, r=alexcrichtonbors-0/+2
Start shipping the Cargo book Fixes #44910 Fixes #39588 See both of those bugs for more details.
2017-11-15Add universal_impl_trait unstable-book entryChristopher Vittal-0/+32
2017-11-14link the cargo book into the bookshelfsteveklabnik-0/+2
2017-11-08std: Remove `rand` crate and moduleAlex Crichton-5/+0
This commit removes the `rand` crate from the standard library facade as well as the `__rand` module in the standard library. Neither of these were used in any meaningful way in the standard library itself. The only need for randomness in libstd is to initialize the thread-local keys of a `HashMap`, and that unconditionally used `OsRng` defined in the standard library anyway. The cruft of the `rand` crate and the extra `rand` support in the standard library makes libstd slightly more difficult to port to new platforms, namely WebAssembly which doesn't have any randomness at all (without interfacing with JS). The purpose of this commit is to clarify and streamline randomness in libstd, focusing on how it's only required in one location, hashmap seeds. Note that the `rand` crate out of tree has almost always been a drop-in replacement for the `rand` crate in-tree, so any usage (accidental or purposeful) of the crate in-tree should switch to the `rand` crate on crates.io. This then also has the further benefit of avoiding duplication (mostly) between the two crates!
2017-11-04Update reference link in doc's 404Ryan Scheel-1/+1
It's currently linking to a page that says it's on the page I'm changing the link too.
2017-11-04rustdoc book: talk about #![doc(test(...))] in doctests chapterQuietMisdreavus-6/+8
2017-11-04rustdoc book: add #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))]QuietMisdreavus-0/+20
2017-11-04Auto merge of #45394 - davidtwco:rfc-2008, r=petrochenkovbors-0/+75
RFC 2008: Future-proofing enums/structs with #[non_exhaustive] attribute This work-in-progress pull request contains my changes to implement [RFC 2008](https://github.com/rust-lang/rfcs/pull/2008). The related tracking issue is #44109. As of writing, enum-related functionality is not included and there are some issues related to tuple/unit structs. Enum related tests are currently ignored. WIP PR requested by @nikomatsakis [in Gitter](https://gitter.im/rust-impl-period/WG-compiler-middle?at=59e90e6297cedeb0482ade3e).
2017-11-03Added page to unstable book.David Wood-0/+75
2017-11-03update unstable book and error exampleleonardo.yvens-3/+1
2017-10-28Update the book for a fix to the print buttonCarol (Nichols || Goulding)-0/+0
Fixes #45552.
2017-10-28Rollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnikkennytm-4/+4
Fixed rustc_on_unimplemented example in Unstable Book I saw [this](https://doc.rust-lang.org/beta/unstable-book/language-features/on-unimplemented.html) example and it seemed wrong. This fixes the example to emit an error message that makes more sense.
2017-10-27Auto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrumbors-0/+0
Bump to 1.23 and update bootstrap This commit updates the bootstrap compiler, bumps the version to 1.23, updates Cargo, updates books, and updates crates.io dependencies
2017-10-27Fixed rustc_on_unimplemented example in Unstable BookNadav Zingerman-4/+4
2017-10-26Bump to 1.23 and update bootstrapAlex Crichton-0/+0
This commit updates the bootstrap compiler, bumps the version to 1.23, updates Cargo, updates books, and updates crates.io dependencies
2017-10-25Fix formatting in unstable book's attr-literals sectionsteveklabnik-12/+12
2017-10-24Auto merge of #45446 - leodasvacas:remove-libcollections, r=alexcrichtonbors-5/+0
Remove deprecated `collections` crate. The real `collections` was merged with `alloc`, this facade was introduced [in this PR](https://github.com/rust-lang/rust/pull/42720) to give `#[no_std]` users time to adapt. This was done at least two cycles ago, now we can consider removing it for good.
2017-10-22`crate` shorthand visibility modifierZack M. Davis-0/+20
With regrets, this breaks rustfmt and rls. This is in the matter of #45388.
2017-10-22Remove deprecated `collections` crate.leonardo.yvens-5/+0
This reverts commit 6484258f1749499d3e51685df867b3d460a7f0be.
2017-10-19Rollup merge of #45217 - SimonSapin:alloc-doc, r=steveklabnikkennytm-59/+25
Fix out of date unstable book entries for `alloc_*` features. The `alloc_jemalloc` crate does not provide a type to use with `#[global_allocator]`, and (according to Alex) `extern crate alloc_jemalloc;` alone became a no-op when `#[global_allocator]` was introduced.
2017-10-19Rollup merge of #45181 - Havvy:doc-unstable-lang-items, r=frewsxcvkennytm-0/+92
List of all lang items in unstable book. I don't know how to link to the source code correctly, so I just put the information aside the lang item name.
2017-10-17List of all lang items in unstable book.Havvy-0/+92
2017-10-17Rollup merge of #45308 - dbrgn:headlines, r=steveklabnikkennytm-3/+3
Rustdoc book: Add missing headlines Some options were missing headlines, which looked a bit inconsistent.
2017-10-15Rustdoc book: Add missing headlinesDanilo Bargen-3/+3
Some options were missing headlines, which looked a bit inconsistent.
2017-10-15Fix typo in rustdoc bookDanilo Bargen-3/+3
2017-10-15Rollup merge of #45250 - brauliobz:non-ascii-idents-details, r=steveklabnikkennytm-1/+31
Moved details of unstable non-ascii identifiers from the Reference Moved details of unstable non-ascii identifiers from the Reference to the Unstable book r? @steveklabnik
2017-10-14Auto merge of #45102 - petrochenkov:noar, r=alexcrichtonbors-3/+0
cleanup: rustc doesn't use an external archiver cc https://github.com/rust-lang/rust/pull/45090 r? @alexcrichton
2017-10-13Fixed link to keywords page in the referenceBráulio Bezerra-1/+1
2017-10-13remove duplicate stubstinaun-7/+0
2017-10-12Moved details of unstable non-ascii identifiers from the Reference to the ↵Bráulio Bezerra-1/+31
Unstable book
2017-10-12Fix out of date unstable book entries for `alloc_*` features.Simon Sapin-59/+25
2017-10-10formatting fixestinaun-22/+20
2017-10-10unstable book: fn_traitstinaun-1/+36
2017-10-10unstable book: unboxed_closurestinaun-0/+25
2017-10-10unstable book: OIBITtinaun-0/+49
2017-10-09cleanup: rustc doesn't use an external archiverVadim Petrochenkov-3/+0
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-0/+58
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06Auto merge of #44734 - mchlrhw:wip/hashmap-entry-and-then, r=BurntSushibors-0/+77
Implement `and_modify` on `Entry` ## Motivation `Entry`s are useful for allowing access to existing values in a map while also allowing default values to be inserted for absent keys. The existing API is similar to that of `Option`, where `or` and `or_with` can be used if the option variant is `None`. The `Entry` API is, however, missing an equivalent of `Option`'s `and_then` method. If it were present it would be possible to modify an existing entry before calling `or_insert` without resorting to matching on the entry variant. Tracking issue: https://github.com/rust-lang/rust/issues/44733.
2017-10-06Implement `entry_and_modify`mchlrhw-0/+77
2017-10-02update books for next releasesteveklabnik-0/+0
Also fixes some stdlib links to the reference which have changed.
2017-09-30Docs: Add trace_macros! to unstable bookDanilo Bargen-0/+39